From 083e85412be8f21159f6408830c1c58cc2a34df1 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 26 Jul 2023 07:08:52 -0700 Subject: [PATCH] runtime removal --- code/modules/projectiles/gun_helpers.dm | 3 +++ code/modules/projectiles/guns/specialist.dm | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index a60773c88be7..ead1b24bd9d7 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -700,6 +700,9 @@ DEFINES in setup.dm, referenced here. CRASH("add_firemode called with a resulting gun_firemode_list length of [length(gun_firemode_list)].") /obj/item/weapon/gun/proc/remove_firemode(removed_firemode, mob/user) + if(!(removed_firemode in gun_firemode_list)) + return + if(!length(gun_firemode_list) || (length(gun_firemode_list) == 1)) CRASH("remove_firemode called with gun_firemode_list length [length(gun_firemode_list)].") diff --git a/code/modules/projectiles/guns/specialist.dm b/code/modules/projectiles/guns/specialist.dm index 93010a93f17b..f1ae2b4bca66 100644 --- a/code/modules/projectiles/guns/specialist.dm +++ b/code/modules/projectiles/guns/specialist.dm @@ -267,7 +267,7 @@ if(toggling_action) toggling_action.update_button_icon() -/obj/item/weapon/gun/rifle/sniper/verb/toggle_laser() +/obj/item/weapon/gun/rifle/sniper/verb/toggle_gun_laser() set category = "Weapons" set name = "Toggle Laser" set desc = "Toggles your laser on or off." @@ -275,7 +275,7 @@ var/obj/item/weapon/gun/rifle/sniper/sniper = get_active_firearm(usr) if((sniper == src) && has_aimed_shot) - toggle_laser(user) + toggle_laser(usr) //Pow! Headshot. /obj/item/weapon/gun/rifle/sniper/M42A