From 0119e812d830fd7f92b6622f7ed20b37ca9de2d0 Mon Sep 17 00:00:00 2001 From: FluffMedic <109300046+FluffMedic@users.noreply.github.com> Date: Thu, 18 Dec 2025 21:49:56 -0500 Subject: [PATCH] Alters gunbox code (#18888) --- code/game/objects/items/gunbox.dm | 6 ++++++ code/game/objects/items/gunbox_vr.dm | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/code/game/objects/items/gunbox.dm b/code/game/objects/items/gunbox.dm index 4675f00a6ce..96b049de496 100644 --- a/code/game/objects/items/gunbox.dm +++ b/code/game/objects/items/gunbox.dm @@ -14,6 +14,8 @@ options["MarsTech R1 (.45)"] = list(/obj/item/gun/projectile/revolver/detective45, /obj/item/ammo_magazine/s45/rubber, /obj/item/ammo_magazine/s45/rubber) options["MarsTech P92X (9mm)"] = list(/obj/item/gun/projectile/p92x/rubber, /obj/item/ammo_magazine/m9mm/rubber, /obj/item/ammo_magazine/m9mm/rubber) var/choice = tgui_input_list(user,"Would you prefer a pistol or a revolver?", "Gun!", options) + if(!choice) + return if(src && choice) var/list/things_to_spawn = options[choice] for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo. @@ -33,6 +35,8 @@ options["Stun Revolver"] = list(/obj/item/gun/energy/stunrevolver/detective, /obj/item/cell/device/weapon, /obj/item/cell/device/weapon) options["Taser"] = list(/obj/item/gun/energy/taser, /obj/item/cell/device/weapon, /obj/item/cell/device/weapon) var/choice = tgui_input_list(user,"Please, select an option.", "Stun Gun!", options) + if(!choice) + return if(src && choice) var/list/things_to_spawn = options[choice] for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo. @@ -54,6 +58,8 @@ options["Écureuil Olive (10mm)"] = list(/obj/item/gun/projectile/ecureuil/tac, /obj/item/ammo_magazine/m10mm/pistol, /obj/item/ammo_magazine/m10mm/pistol) options["Écureuil Tan (10mm)"] = list(/obj/item/gun/projectile/ecureuil/tac2, /obj/item/ammo_magazine/m10mm/pistol, /obj/item/ammo_magazine/m10mm/pistol) var/choice = tgui_input_list(user,"Please, select an option.", "Gun!", options) + if(!choice) + return if(src && choice) var/list/things_to_spawn = options[choice] for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo. diff --git a/code/game/objects/items/gunbox_vr.dm b/code/game/objects/items/gunbox_vr.dm index 00977fec6fd..3a9a2c4f25c 100644 --- a/code/game/objects/items/gunbox_vr.dm +++ b/code/game/objects/items/gunbox_vr.dm @@ -12,6 +12,8 @@ options["Warden's combat shotgun"] = list(/obj/item/gun/projectile/shotgun/pump/combat/warden, /obj/item/ammo_magazine/ammo_box/b12g/beanbag) options["Warden's compact shotgun"] = list(/obj/item/gun/projectile/shotgun/compact/warden, /obj/item/ammo_magazine/ammo_box/b12g/beanbag) var/choice = tgui_input_list(user,"Choose your boomstick!", "Shotgun!", options) + if(!choice) + return if(src && choice) var/list/things_to_spawn = options[choice] for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo. @@ -35,6 +37,8 @@ options["LAEP80 \"Thor\" (Stun/Laser)"] = list(/obj/item/gun/energy/gun, /obj/item/cell/device/weapon, /obj/item/cell/device/weapon) options["MarsTech P92X (9mm)"] = list(/obj/item/gun/projectile/p92x/rubber, /obj/item/ammo_magazine/m9mm/rubber, /obj/item/ammo_magazine/m9mm) var/choice = tgui_input_list(user,"Would you prefer a ballistic pistol or an energy gun?", "Gun!", options) + if(!choice) + return if(src && choice) var/list/things_to_spawn = options[choice] for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo.