From e8fe0f4e1e990ef4040d79337a1ad60d1cf3280a Mon Sep 17 00:00:00 2001 From: Bloop <13398309+vinylspiders@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:49:42 -0400 Subject: [PATCH] Fixes ballistic weapons not making any firing sound (#86250) ## About The Pull Request Fixes https://github.com/NovaSector/NovaSector/issues/4337 https://github.com/tgstation/tgstation/pull/85470 added some checks in `/obj/item/gun/ballistic/shoot_live_shot()` that were causing runtimes in probably most of the ballistic gun types. To see for yourself just take out a revolver and shoot it a few times, then check the runtimes log. The runtime was preventing the parent `/obj/item/gun/ballistic/shoot_live_shot()` from being called, which is where the firing sound gets played. Fix is just acknowledging that `chambered` can be null at this point in the call chain and adding a quick check in there for good measure. Also fixes the runtime here, though that one didn't cause any functional bugs apart from polluting the log since it occurs at the end of the proc. ![KZXgDrEAnV](https://github.com/user-attachments/assets/f22dcc6a-fffd-4d10-abdd-e5d98856939b) Also adds a missing multiline list comma that I noticed cough. ## Why It's Good For The Game Guns go boom again. ## Changelog :cl: fix: due to a clerical error, all ballistic guns were shipping with built-in silencers. this has been resolved-they will now make noise once again when fired. /:cl: --- code/datums/components/face_decal.dm | 3 ++- code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/datums/components/face_decal.dm b/code/datums/components/face_decal.dm index 674f17fe86c..f045a4f18df 100644 --- a/code/datums/components/face_decal.dm +++ b/code/datums/components/face_decal.dm @@ -118,7 +118,8 @@ GLOBAL_LIST_INIT(creamable, typecacheof(list( /mob/living/carbon/human, /mob/living/basic/pet/dog/corgi, - /mob/living/silicon/ai))) + /mob/living/silicon/ai, +))) /datum/component/face_decal/creampie/Initialize() . = ..() diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 2590609c73b..78dbcdeff4a 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -220,7 +220,7 @@ ignored_mobs = user ) - if(chambered.integrity_damage) + if(chambered?.integrity_damage) take_damage(chambered.integrity_damage, sound_effect = FALSE) /obj/item/gun/atom_destruction(damage_flag) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 9471051440e..0763a22f8a4 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -480,6 +480,8 @@ return ..() /obj/item/gun/ballistic/shoot_live_shot(mob/living/user, pointblank = 0, atom/pbtarget = null, message = 1) + if(isnull(chambered)) + return ..() if(can_misfire && chambered.can_misfire != FALSE) misfire_probability += misfire_percentage_increment misfire_probability = clamp(misfire_probability, 0, misfire_probability_cap)