A_BossDeath doesn't fully check replaced actors

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A_BossDeath doesn't fully check replaced actors

Re: A_BossDeath doesn't fully check replaced actors

by Major Cooke » Tue Oct 15, 2019 12:46 pm

The PR was merged. This can be closed.

Re: A_BossDeath doesn't fully check replaced actors

by Major Cooke » Tue Oct 01, 2019 12:27 pm

Fair enough.

I've made a PR which fixes the issue. Used the same PK3 in the first post for testing to make sure.

A_BossDeath itself rightfully checks for the replacee type, but the reliance upon CheckBossDeath itself from within meant it would succeed if just that singular type alone was all dead, instead of the replaced actor type. That PR simply changes the function so it requires all replaced of the matching type to be dead, since CheckReplacee allows for assigning multiple replacees. This will finally allow for a perfect alternative and fully functioning RandomSpawner system replacement.

Re: A_BossDeath doesn't fully check replaced actors

by Gez » Tue Sep 10, 2019 11:06 am

Major Cooke wrote:In particular, RandomSpawners rely upon the BOSS flag, which makes sense for cyberdemon and spider mastermind classes, but not barons, fatsos and arachnotrons.
It looks for the BOSSDEATH flag too.

https://github.com/coelckers/gzdoom/blo ... #L235:L241

A_BossDeath doesn't fully check replaced actors

by Major Cooke » Tue Sep 10, 2019 10:32 am

Load the attached file and start on MAP07 (hard skill to ensure the fatsos are randomized). Kill all of one color, and the walls will lower, which is not supposed to happen.

CheckReplacee was developed with the idea of not needing to to use RandomSpawners or any custom spawners. In particular, RandomSpawners rely upon the BOSS flag, which makes sense for cyberdemon and spider mastermind classes, but not barons, fatsos and arachnotrons.

The problematic code lies in CheckBossDeath function in p_enemy.cpp:

Code: Select all

while ( (other = iterator.Next ()) )
{
	if (other != actor &&
		(other->health > 0 || (other->flags & MF_ICECORPSE))
		&& other->GetClass() == actor->GetClass())
	{ // Found a living boss
		// [RH] Frozen bosses don't count as dead until they shatter
		return false;
	}
}
In particular this only compares direct classes instead of checking the replacees. As seen in my example package, I have an event handler set up to indicate the replacee of Fatsos 1 & 2 to be Fatso itself.
Attachments
BossDeathBug.pk3
(570 Bytes) Downloaded 28 times

Top