Skip to content

Commit c57322d

Browse files
TaranDahlCrimRecya
andcommitted
Fix incorrect check in pr 1863
Co-Authored-By: 绯红热茶 <169989423+crimrecya@users.noreply.github.com>
1 parent 7a190d2 commit c57322d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Ext/Techno/Hooks.Misc.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ DEFINE_HOOK(0x4D962B, FootClass_SetDestination_RecycleFLH, 0x5)
266266
GET(FootClass* const, pThis, EBP);
267267

268268
auto const pCarrier = pThis->SpawnOwner;
269+
auto const pDest = pThis->Destination;
269270

270-
if (pCarrier && pCarrier == pThis->Destination) // This is a spawner returning to its carrier.
271+
if (pCarrier && pCarrier == pDest) // This is a spawner returning to its carrier.
271272
{
272273
auto const pCarrierTypeExt = TechnoExt::ExtMap.Find(pCarrier)->TypeExtData;
273274
auto const& FLH = pCarrierTypeExt->Spawner_RecycleCoord;
@@ -278,11 +279,11 @@ DEFINE_HOOK(0x4D962B, FootClass_SetDestination_RecycleFLH, 0x5)
278279
*pDestCrd += TechnoExt::GetFLHAbsoluteCoords(pCarrier, FLH, pCarrierTypeExt->Spawner_RecycleOnTurret) - pCarrier->GetCoords();
279280
}
280281
}
281-
else if (pThis->Destination->WhatAmI() == AbstractType::Building
282-
&& pThis->QueuedMission != Mission::Enter && pThis->GetCurrentMission() != Mission::Enter)
282+
else if (pDest->WhatAmI() == AbstractType::Building
283+
&& pThis->SendCommand(RadioCommand::QueryCanEnter, static_cast<BuildingClass*>(pDest)) != RadioCommand::AnswerPositive)
283284
{
284285
GET(CoordStruct*, pDestCrd, EAX);
285-
auto crd = pThis->Destination->GetCoords();
286+
auto crd = pDest->GetCoords();
286287
crd.X = ((crd.X >> 8) << 8) + 128;
287288
crd.Y = ((crd.Y >> 8) << 8) + 128;
288289
*pDestCrd = crd;

0 commit comments

Comments
 (0)