Fixed CheckBossDeath not checking for actor replacements.

- A_BossDeath relies upon this function in particular.
- This completes CheckReplacee's purpose, allowing for varied actors to count as one particular actor, such as a Fatso for map07 and avoid lowering the walls until they are all dead.
This commit is contained in:
Major Cooke 2019-10-01 13:17:49 -05:00 committed by drfrag
parent 80442db4fe
commit 62b3ed7d75

View file

@ -3057,11 +3057,19 @@ int CheckBossDeath (AActor *actor)
TThinkerIterator<AActor> iterator;
AActor *other;
PClassActor *cls = actor->GetClass();
FName type = cls->GetReplacee()->TypeName;
while ( (other = iterator.Next ()) )
{
if (other != actor &&
(other->health > 0 || (other->flags & MF_ICECORPSE))
&& other->GetClass() == actor->GetClass())
if (other == actor)
continue;
PClassActor *ocls = other->GetClass();
FName otype = ocls->GetReplacee()->TypeName;
if ((other->health > 0 || (other->flags & MF_ICECORPSE))
&& (ocls == cls || otype == type))
{ // Found a living boss
// [RH] Frozen bosses don't count as dead until they shatter
return false;