Skip to content

Commit

Permalink
fix #1257
Browse files Browse the repository at this point in the history
  • Loading branch information
chaserli committed May 9, 2024
1 parent 79c0ade commit 2503e82
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Ext/Building/Hooks.Grinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ DEFINE_HOOK(0x4D4CD3, FootClass_Mission_Eaten_Grinding, 0x6)
DEFINE_HOOK(0x4D4B43, FootClass_Mission_Capture_ForbidUnintended, 0x6)
{
GET(InfantryClass*, pThis, EDI);
enum { LosesDestination = 0x4D4BD1, Go = 0 };
enum { LosesDestination = 0x4D4BD1 };

auto pBld = specific_cast<BuildingClass*>(pThis->Destination);
if (!pThis || !pBld || pThis->Target)
return Go;
return 0;

if (pThis->Type->Engineer)
return Go;
return 0;

if (pBld->Type->Spyable && pThis->Type->Infiltrate && !pThis->Owner->IsAlliedWith(pBld->Owner))
return Go;
if (pThis->Type->Infiltrate && !pThis->Owner->IsAlliedWith(pBld->Owner))
return 0;// had to be a bit tolerable on this one due to interaction issue

if (pBld->Type->CanBeOccupied && (pThis->Type->Occupier || pThis->Type->Assaulter))
return Go;
return 0;

if (pThis->Type->C4 || pThis->HasAbility(Ability::C4))
return Go;
return 0;

// If you can't do any of these then why are you here?
pThis->SetDestination(nullptr, false);
Expand Down

0 comments on commit 2503e82

Please sign in to comment.