Skip to content

Commit 27806d3

Browse files
committed
Fix c86b162 causing chrono miner enter an invincible state when returning refinery
1 parent 1ab7c99 commit 27806d3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Ext/Techno/Hooks.Transport.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,17 @@ DEFINE_HOOK(0x7196BB, TeleportLocomotionClass_Process_MarkDown, 0xA)
521521
// An impassable invisible barrier will be generated on the bridge (the object linked list of the cell will leave it)
522522
// And the transport vehicle will board on the vehicle itself (BFRT Passenger:..., BFRT)
523523
// If any infantry attempts to pass through this position on the bridge later, it will cause the game to freeze
524-
if (pLinkedTo->GetCurrentMission() != Mission::Enter)
524+
auto shouldMarkDown = [pLinkedTo]()
525+
{
526+
if (pLinkedTo->GetCurrentMission() != Mission::Enter)
527+
return true;
528+
529+
const auto pEnter = pLinkedTo->GetNthLink();
530+
531+
return (!pEnter || pEnter->GetTechnoType()->Passengers <= 0);
532+
};
533+
534+
if (shouldMarkDown())
525535
pLinkedTo->Mark(MarkType::Down);
526536

527537
return SkipGameCode;

0 commit comments

Comments
 (0)