- fixed: A_CustomBulletAttack may not rely on the parameter default setter to get a valid puff. This must be checked explicitly in the functions body to ensure it is never NULL.

This commit is contained in:
Christoph Oelckers 2016-05-27 11:39:44 +02:00
parent b926cf35d5
commit d43ea33031

View file

@ -1463,7 +1463,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
PARAM_ANGLE (spread_z);
PARAM_INT (numbullets);
PARAM_INT (damageperbullet);
PARAM_CLASS_OPT (pufftype, AActor) { pufftype = PClass::FindActor(NAME_BulletPuff); }
PARAM_CLASS_OPT (pufftype, AActor) { pufftype = nullptr; }
PARAM_FLOAT_OPT (range) { range = 0; }
PARAM_INT_OPT (flags) { flags = 0; }
PARAM_INT_OPT (ptr) { ptr = AAPTR_TARGET; }
@ -1487,6 +1487,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack)
bangle = self->Angles.Yaw;
if (!(flags & CBAF_NOPITCH)) bslope = P_AimLineAttack (self, bangle, MISSILERANGE);
if (pufftype == nullptr) pufftype = PClass::FindActor(NAME_BulletPuff);
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
for (i = 0; i < numbullets; i++)