mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 15:22:08 +00:00
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:
parent
e166563ac9
commit
d0a256b51c
1 changed files with 12 additions and 3 deletions
|
@ -3050,15 +3050,24 @@ int CheckBossDeath (AActor *actor)
|
||||||
auto iterator = actor->Level->GetThinkerIterator<AActor>();
|
auto iterator = actor->Level->GetThinkerIterator<AActor>();
|
||||||
AActor *other;
|
AActor *other;
|
||||||
|
|
||||||
|
PClassActor *cls = actor->GetClass();
|
||||||
|
FName type = cls->GetReplacee(actor->Level)->TypeName;
|
||||||
|
|
||||||
while ( (other = iterator.Next ()) )
|
while ( (other = iterator.Next ()) )
|
||||||
{
|
{
|
||||||
if (other != actor &&
|
if (other == actor)
|
||||||
(other->health > 0 || (other->flags & MF_ICECORPSE))
|
continue;
|
||||||
&& other->GetClass() == actor->GetClass())
|
|
||||||
|
PClassActor *ocls = other->GetClass();
|
||||||
|
FName otype = ocls->GetReplacee(other->Level)->TypeName;
|
||||||
|
|
||||||
|
if ((other->health > 0 || (other->flags & MF_ICECORPSE))
|
||||||
|
&& (ocls == cls || otype == type))
|
||||||
{ // Found a living boss
|
{ // Found a living boss
|
||||||
// [RH] Frozen bosses don't count as dead until they shatter
|
// [RH] Frozen bosses don't count as dead until they shatter
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// The boss death is good
|
// The boss death is good
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue