Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,17 @@ Bool AIUpdateInterface::chooseLocomotorSetExplicit(LocomotorSetType wst)
const LocomotorTemplateVector* set = getAIUpdateModuleData()->findLocomotorTemplateVector(wst);
if (set)
{
// TheSuperHackers @bugfix wh1ter0se69 10/08/2026 Do not rebuild the locomotor set of a dead
// aircraft. Rebuilding discards the Locomotor instance that a slow death module mutated to
// ground it, so the wreck regains full lift from template and keeps flying.
#if !RETAIL_COMPATIBLE_CRC
Object* obj = getObject();
// LOCOMOTORSET_INVALID means no set has been built yet, so this refuses rebuilds only.
if (obj != nullptr && obj->isEffectivelyDead() && obj->isKindOf(KINDOF_AIRCRAFT)
&& m_curLocomotorSet != LOCOMOTORSET_INVALID)
return FALSE;
#endif

m_locomotorSet.clear();
m_curLocomotor = nullptr;
for (size_t i = 0; i < set->size(); ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,17 @@ Bool AIUpdateInterface::chooseLocomotorSetExplicit(LocomotorSetType wst)
const LocomotorTemplateVector* set = getAIUpdateModuleData()->findLocomotorTemplateVector(wst);
if (set)
{
// TheSuperHackers @bugfix wh1ter0se69 10/08/2026 Do not rebuild the locomotor set of a dead
// aircraft. Rebuilding discards the Locomotor instance that a slow death module mutated to
// ground it, so the wreck regains full lift from template and keeps flying.
#if !RETAIL_COMPATIBLE_CRC
Object* obj = getObject();
// LOCOMOTORSET_INVALID means no set has been built yet, so this refuses rebuilds only.
if (obj != nullptr && obj->isEffectivelyDead() && obj->isKindOf(KINDOF_AIRCRAFT)

@Caball009 Caball009 Aug 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obj->isKindOf(KINDOF_AIRCRAFT)
This looks like a code smell to me, as this is an aircraft specific exception in a generic function.

  1. Please find out where this can be fixed in jet / heli / chinook specific code instead.
  2. You identified that this code:
if (!obj->isEffectivelyDead())
	loco->setMaxLift(BIGNUM);

is used to fight the same bug. I think it deserves a look if the entire issue needs a different kind of fix that doesn't need multiple checks around max lift & locomotor changes.

I included two replays in the issue thread, you can use those to find the best solution. Please refrain from posting LLM generated responses at code reviewers.

&& m_curLocomotorSet != LOCOMOTORSET_INVALID)
return FALSE;
#endif

m_locomotorSet.clear();
m_curLocomotor = nullptr;
for (size_t i = 0; i < set->size(); ++i)
Expand Down
Loading