Skip to content

Commit

Permalink
[Minor] Another reloader crash fix (Phobos-developers#1356)
Browse files Browse the repository at this point in the history
Current techno destructor will only clear TransportReloader list when
the techno has a Transporter. This might cause issue when the
Transporter somehow being destroyed earlier than the techno, resulting
in the list fails to be cleared and crash. Removed that Transporter
condition to prevent this
  • Loading branch information
Coronia authored Aug 14, 2024
1 parent f0dcc25 commit 833767f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ext/Techno/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TechnoExt::ExtData::~ExtData()
vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end());
}

if (pThis->Transporter && pThis->WhatAmI() != AbstractType::Aircraft && pThis->WhatAmI() != AbstractType::Building
if (pThis->WhatAmI() != AbstractType::Aircraft && pThis->WhatAmI() != AbstractType::Building
&& pType->Ammo > 0 && pTypeExt->ReloadInTransport)
{
auto& vec = ScenarioExt::Global()->TransportReloaders;
Expand Down

0 comments on commit 833767f

Please sign in to comment.