Class ZBell's Activate looks odd

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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 Reply
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

Class ZBell's Activate looks odd

Post by Fishytza »

Not a really a bug, just something that bothers me. No clue if it's intentional.
https://github.com/coelckers/gzdoom/blo ... s.txt#L883

Code: Select all

	override void Activate (Actor activator)
	{
		if (health > 0) A_Die();
		{
			DamageMobj (activator, activator, 10, 'Melee', DMG_THRUSTLESS); // 'ring' the bell
		}
   }
Why is DamageMobj there if A_Die is already used?
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Class ZBell's Activate looks odd

Post by Nash »

And why is that part enclosed in an additional pair of {}'s? Is that some programming technique I'm unaware of?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Class ZBell's Activate looks odd

Post by _mental_ »

Before scriptification the related code was the following:

Code: Select all

void AZBell::Activate (AActor *activator)
{
	if (health > 0)
	{
		P_DamageMobj (this, activator, activator, 10, NAME_Melee, DMG_THRUSTLESS); // 'ring' the bell
	}
}
Most likely A_Die(); part shouldn't be there.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Class ZBell's Activate looks odd

Post by Graf Zahl »

How did that get there? Looks like some accidental Copy/Paste
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Class ZBell's Activate looks odd

Post by _mental_ »

Fixed in 4101e9b.
Post Reply

Return to “Closed Bugs [GZDoom]”