A_Punch glitches on puff replacements

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
dawnbreez
Posts: 199
Joined: Wed Jul 08, 2015 12:29 pm

A_Punch glitches on puff replacements

Post by dawnbreez »

GZDoom 3.3.2-m
Expected behavior: A_Punch creates a BulletPuff which respects replacement.
Actual behavior: A_Punch creates a modified version of BulletPuff which has entirely new state info but the same flags as the BulletPuff replacement.

I discovered this bug while working on BulletZ, which relies on replacement of the BulletPuff actor for its effects. In prior versions of GZDoom, A_Punch would perform as expected, producing my BulletPuff replacement; however, in the current version of GZDoom, it appears to create a new puff. This puff inherits the flags and properties of whatever replaces BulletPuff--i.e., in the proof-of-concept below it inherits +ALWAYSPUFF and its damage factor is changed--but it completely replaces the state info with what appears to be "PUFF BC 4". The following code will produce this effect:

In the "zscript" lump:

Code: Select all

class DummyPuff : BulletPuff replaces BulletPuff
{
	//Bulletpuff that does no damage, and instead makes a fireball appear in front of you for a little bit.
	default
	{
		DamageType "DummyDamage";
		+ALWAYSPUFF;
	}
	states
	{
		Spawn:
		Death:
		XDeath:	
		Death.Sky:
		Bounce.Wall:
			BAL1 AB 4 A_PlaySound("imp/shotx");
			Stop;
	}
	//A_Punch will instead spawn a sprite that appears to be PUFF AB 4, while retaining the flags
	//and properties of this puff (i.e., no damage, no sound, and behaves with ALWAYSPUFF).
}
And in MAPINFO:

Code: Select all

damagetype DummyDamage
{
	factor = 0
}
I've also attached the same code in a pk3 on this post.
Attachments
dummypunch.pk3
Proof of Concept.
(567 Bytes) Downloaded 23 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Punch glitches on puff replacements

Post by Graf Zahl »

You forgot to define the Melee state in your replacement. But since it inherits from BulletPuff it will just use the base class's melee state for a melee-attack-related puff.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: A_Punch glitches on puff replacements

Post by Gez »

See [wiki=Classes:BulletPuff]wiki[/wiki] for documentation. If you want to catch all states a puff can appear in, you need to cover Crash and Melee too.
Post Reply

Return to “Closed Bugs [GZDoom]”