From 37a15253dd8e29e422af5f1dd083924fc74feed6 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Sat, 11 Jan 2020 12:46:00 +0100 Subject: [PATCH] fix crash when attack sound is missing --- Source/p_enemy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/p_enemy.c b/Source/p_enemy.c index 5f11ae9d..551a8421 100644 --- a/Source/p_enemy.c +++ b/Source/p_enemy.c @@ -1852,7 +1852,11 @@ void A_SkullAttack(mobj_t *actor) dest = actor->target; actor->flags |= MF_SKULLFLY; + // [FG] fix crash when attack sound is missing + if (actor->info->attacksound) + { S_StartSound(actor, actor->info->attacksound); + } A_FaceTarget(actor); an = actor->angle >> ANGLETOFINESHIFT; actor->momx = FixedMul(SKULLSPEED, finecosine[an]); @@ -1877,7 +1881,11 @@ void A_BetaSkullAttack(mobj_t *actor) int damage; if (!actor->target || actor->target->type == MT_SKULL) return; + // [FG] fix crash when attack sound is missing + if (actor->info->attacksound) + { S_StartSound(actor, actor->info->attacksound); + } A_FaceTarget(actor); damage = (P_Random(pr_skullfly)%8+1)*actor->info->damage; P_DamageMobj(actor->target, actor, actor, damage);