Core/Movement: added a safety and error output if a follow target has a dead / invalid follower reference that should have been cleared before.

This commit is contained in:
Ovahlord committed 2020-06-28 14:23:02 +02:00
1 parent 9bd1cb8970
commit f1b16b4820
2 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -9237,7 +9237,7 @@ void Unit::RemoveFormationFollower(Unit* follower)
Unit* follwingUnit = *itr;
// Cleaning up dead references while at it
if (!follwingUnit || follwingUnit == follower)
_formationFollowers.erase(itr);
itr = _formationFollowers.erase(itr);
else
itr++;
}