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).
}
Code: Select all
damagetype DummyDamage
{
factor = 0
}