mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
- Fixed possible NULL pointer derefs in P_LineAttack()
SVN r4264 (trunk)
This commit is contained in:
parent
894c4198b0
commit
b418f7de8d
1 changed files with 4 additions and 3 deletions
|
@ -3546,9 +3546,10 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
|
|||
(t1->player->ReadyWeapon->flags2 & MF2_THRUGHOST)) ||
|
||||
(puffDefaults && (puffDefaults->flags2 & MF2_THRUGHOST));
|
||||
|
||||
// if the puff uses a non-standard damage type this will override default, hitscan and melee damage type.
|
||||
// if the puff uses a non-standard damage type, this will override default, hitscan and melee damage type.
|
||||
// All other explicitly passed damage types (currenty only MDK) will be preserved.
|
||||
if ((damageType == NAME_None || damageType == NAME_Melee || damageType == NAME_Hitscan) && puffDefaults->DamageType != NAME_None)
|
||||
if ((damageType == NAME_None || damageType == NAME_Melee || damageType == NAME_Hitscan) &&
|
||||
puffDefaults != NULL && puffDefaults->DamageType != NAME_None)
|
||||
{
|
||||
damageType = puffDefaults->DamageType;
|
||||
}
|
||||
|
@ -3568,7 +3569,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
|
|||
{ // Play miss sound
|
||||
S_Sound (t1, CHAN_WEAPON, puffDefaults->ActiveSound, 1, ATTN_NORM);
|
||||
}
|
||||
if (puffDefaults->flags3 & MF3_ALWAYSPUFF)
|
||||
if (puffDefaults != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF)
|
||||
{ // Spawn the puff anyway
|
||||
puff = P_SpawnPuff (t1, pufftype, trace.X, trace.Y, trace.Z, angle - ANG180, 2, puffFlags);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue