Skip to content

Commit

Permalink
Make sure that we don't accidentally reset a dead spawn to be reloadi…
Browse files Browse the repository at this point in the history
…ng if it as killed by Limbo()
  • Loading branch information
ZivDero committed Feb 22, 2025
1 parent 534e5ae commit 804ab08
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/new/spawnmanager/spawnmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,13 @@ void SpawnManagerClass::AI()

if (owner_coord == spawnee_coord && std::abs(spawnee->Coord.Z - Owner->Coord.Z) < 20)
{
spawnee->Limbo();
/**
* Limbo() can destroy the unit in certain situations, and we don't want to affect the status if the spawnee
* was blown up (Detach() sets it to Dead). Do not touch the order of the statements here or all hell breaks loose.
*/
control->Status = SpawnControlStatus::Reloading;
control->ReloadTimer = ReloadRate;
spawnee->Limbo();
}
else
{
Expand Down

0 comments on commit 804ab08

Please sign in to comment.