@@ -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