From 491a51ecb98f1ab3d8957b6e8741414032ea7d63 Mon Sep 17 00:00:00 2001 From: Samman166 <67894653+Samman166@users.noreply.github.com> Date: Mon, 13 Mar 2023 19:43:27 -0230 Subject: [PATCH] Fixes a bug that allowed turret guns to be fired by mobs. (#20451) * TRIGGER_GUARD_NONE works properly * uses FALSE instead of 0 --- code/game/gamemodes/wizard/rightandwrong.dm | 1 - code/modules/mob/living/living.dm | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm index 114a64de30e..f4317e9e9ee 100644 --- a/code/game/gamemodes/wizard/rightandwrong.dm +++ b/code/game/gamemodes/wizard/rightandwrong.dm @@ -29,7 +29,6 @@ GLOBAL_LIST_INIT(summoned_guns, list( /obj/item/gun/projectile/automatic/l6_saw, /obj/item/gun/projectile/automatic/m90, /obj/item/gun/energy/alien, - /obj/item/gun/energy/gun/turret, /obj/item/gun/energy/pulse/carbine, /obj/item/gun/energy/decloner, /obj/item/gun/energy/mindflayer, diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 70553f3687d..2b314534cec 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1032,7 +1032,10 @@ /mob/living/proc/can_use_guns(obj/item/gun/G) if(G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser() && !issmall(src)) to_chat(src, "You don't have the dexterity to do this!") - return 0 + return FALSE + if(G.trigger_guard == TRIGGER_GUARD_NONE) + to_chat(src, "This gun is only built to be fired by machines!") + return FALSE return 1 /mob/living/start_pulling(atom/movable/AM, state, force = pull_force, show_message = FALSE)