Skip to content

Commit

Permalink
[Minor] Change a human player condition (Phobos-developers#1265)
Browse files Browse the repository at this point in the history
Co-authored-by: chaserli <[email protected]>
  • Loading branch information
Coronia and chaserli authored Jun 1, 2024
1 parent 98b4bb6 commit 4bc1cda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
9 changes: 9 additions & 0 deletions src/Ext/House/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ DEFINE_HOOK(0x7015C9, TechnoClass_Captured_UpdateTracking, 0x6)

if (pConvertTo && pConvertTo->WhatAmI() == pType->WhatAmI())
TechnoExt::ConvertToType(pMe, pConvertTo);

for (auto& trail : pExt->LaserTrails)
{
if (trail.Type->IsHouseColor)
trail.CurrentColor = pNewOwner->LaserColor;
}

if (!I_am_human && You_are_human)
TechnoExt::ChangeOwnerMissionFix(pMe);
}

return 0;
Expand Down
17 changes: 0 additions & 17 deletions src/Ext/Techno/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,6 @@ DEFINE_HOOK(0x6F42F7, TechnoClass_Init, 0x2)
return 0;
}

DEFINE_HOOK(0x4DBF13, FootClass_SetOwningHouse, 0x6)
{
GET(FootClass* const, pThis, ESI);

auto pExt = TechnoExt::ExtMap.Find(pThis);
for (auto& trail : pExt->LaserTrails)
{
if (trail.Type->IsHouseColor)
trail.CurrentColor = pThis->Owner->LaserColor;
}

if (pThis->Owner->IsHumanPlayer)
TechnoExt::ChangeOwnerMissionFix(pThis);

return 0;
}

DEFINE_HOOK_AGAIN(0x7355C0, TechnoClass_Init_InitialStrength, 0x6) // UnitClass_Init
DEFINE_HOOK_AGAIN(0x517D69, TechnoClass_Init_InitialStrength, 0x6) // InfantryClass_Init
DEFINE_HOOK_AGAIN(0x442C7B, TechnoClass_Init_InitialStrength, 0x6) // BuildingClass_Init
Expand Down

0 comments on commit 4bc1cda

Please sign in to comment.