diff --git a/src/p_map.cpp b/src/p_map.cpp index 7a1da4d1e..224719509 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -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); }