-
-
Notifications
You must be signed in to change notification settings - Fork 115
[Vanilla Enhancement] Vehicle disguise to vehicle #1803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
[Vanilla Enhancement] Vehicle disguise to vehicle #1803
Conversation
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem that could lead to a crash.
Others look good, and I think we can make them clearer.
And, I'm not sure if there's anything else that need to process.
@@ -504,6 +523,234 @@ DEFINE_HOOK(0x74691D, UnitClass_UpdateDisguise_EMP, 0x6) | |||
return 0x746931; | |||
} | |||
|
|||
DEFINE_HOOK(0x7466DC, UnitClass_DisguiseAs_DisguiseAsVehicle, 0x6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFINE_HOOK(0x7466D8, UnitClass_DisguiseAs_DisguiseAsVehicle, 0xA)
may be better?
DEFINE_HOOK(0x73C655, UnitClass_DrawSHP_TechnoType, 0x6) | ||
{ | ||
enum { ApplyDisguiseType = 0x73C65B }; | ||
|
||
GET(UnitClass*, pThis, EBP); | ||
|
||
if (pThis->IsDisguised() && !pThis->IsClearlyVisibleTo(HouseClass::CurrentPlayer)) | ||
{ | ||
const auto pTargetType = pThis->GetDisguise(true); | ||
|
||
if (pTargetType && pTargetType->WhatAmI() == UnitTypeClass::AbsID) | ||
{ | ||
R->ECX(pTargetType); | ||
return ApplyDisguiseType; | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x73C69D, UnitClass_DrawSHP_TechnoType2, 0x6) | ||
{ | ||
enum { ApplyDisguiseType = 0x73C6A3 }; | ||
|
||
GET(UnitClass*, pThis, EBP); | ||
|
||
if (pThis->IsDisguised() && !pThis->IsClearlyVisibleTo(HouseClass::CurrentPlayer)) | ||
{ | ||
const auto pTargetType = pThis->GetDisguise(true); | ||
|
||
if (pTargetType && pTargetType->WhatAmI() == UnitTypeClass::AbsID) | ||
{ | ||
R->ECX(pThis->GetDisguise(true)); | ||
return ApplyDisguiseType; | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x73C702, UnitClass_DrawSHP_TechnoType3, 0x6) | ||
{ | ||
enum { ApplyDisguiseType = 0x73C708 }; | ||
|
||
GET(UnitClass*, pThis, EBP); | ||
|
||
if (pThis->IsDisguised() && !pThis->IsClearlyVisibleTo(HouseClass::CurrentPlayer)) | ||
{ | ||
const auto pTargetType = pThis->GetDisguise(true); | ||
|
||
if (pTargetType && pTargetType->WhatAmI() == UnitTypeClass::AbsID) | ||
{ | ||
R->ECX(pThis->GetDisguise(true)); | ||
return ApplyDisguiseType; | ||
} | ||
} | ||
|
||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look the same, I think they should be able to be encapsulated into a function ObjectTypeClass* GetUnitDisguiseAs(UnitClass* pThis)
?
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x73C725, UnitClass_DrawSHP_HasTurret, 0x5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's 0x6 instead of 0x5.
if (pType != pThis->Type) | ||
{ | ||
if (pType->TurretCount > 0 && !pType->IsGattling) | ||
return 0x73B8EC; | ||
else | ||
return 0x73B92F; | ||
} | ||
else | ||
{ | ||
if (!pType->HasMultipleTurrets() || pType->IsGattling) | ||
return 0x73B92F; | ||
else | ||
return 0x73B8FC; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can make it clearer
if (!pType->HasMultipleTurrets() || pType->IsGattling)
return 0x73B92F;
return pType != pThis->Type ? 0x73B8EC : 0x73B8FC;
if (pType != pThis->Type) | ||
{ | ||
if (pType->TurretCount > 0 && !pType->IsGattling) | ||
{ | ||
if (pThis->CurrentTurretNumber < 0) | ||
R->Stack<int>(0x1C, 0); | ||
|
||
return 0x73BC35; | ||
} | ||
else | ||
{ | ||
return 0x73BD79; | ||
} | ||
} | ||
else | ||
{ | ||
if (!pType->HasMultipleTurrets() || pType->IsGattling) | ||
return 0x73BD79; | ||
else | ||
return 0x73BC49; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it can also return 0x73BD79;
first if (!pType->HasMultipleTurrets() || pType->IsGattling)
In
rulesmd.ini
: