From 2d53e6db15fbb4460c2ddd31a7b9c44e397c7710 Mon Sep 17 00:00:00 2001 From: fallcon Date: Wed, 25 Sep 2024 09:43:08 -0500 Subject: [PATCH] clarity of spawning with no ammo. --- code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 5 +++-- code/modules/projectiles/guns/energy.dm | 2 +- code/modules/projectiles/guns/energy/energy_gun.dm | 4 ++-- code/modules/projectiles/guns/energy/laser.dm | 2 +- code/modules/projectiles/guns/energy/special.dm | 2 +- .../guns/manufacturer/etherbor/energy_gunsword.dm | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 7ab6f996096e..2f020c8d11f2 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -288,7 +288,7 @@ //ENERGY //set to true so the gun is given an empty cell - var/dead_cell = FALSE + var/spawn_no_ammo = FALSE // Need to sort ///trigger guard on the weapon. Used for hulk mutations and ashies. I honestly dont know how usefult his is, id avoid touching it diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 6db5af362338..f1000b2b5d11 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -42,7 +42,7 @@ return if (!magazine && default_ammo_type) magazine = new default_ammo_type(src) - if (!default_ammo_type) + if (spawn_no_ammo) get_ammo_list (drop_all = TRUE) chamber_round() update_appearance() @@ -332,7 +332,8 @@ rounds.Add(chambered) if(drop_all) chambered = null - rounds.Add(magazine.ammo_list(drop_all)) + if(magazine) + rounds.Add(magazine.ammo_list(drop_all)) return rounds GLOBAL_LIST_INIT(gun_saw_types, typecacheof(list( diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index a7cbfa81dcff..3eb764ea3ea9 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -61,7 +61,7 @@ . = ..() if(default_ammo_type) cell = new default_ammo_type(src) - if(dead_cell) + if(spawn_no_ammo) cell.use(cell.maxcharge) update_ammo_types() recharge_newshot(TRUE) diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm index d399c94a109f..217c25620c60 100644 --- a/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/code/modules/projectiles/guns/energy/energy_gun.dm @@ -14,7 +14,7 @@ manufacturer = MANUFACTURER_SHARPLITE_NEW /obj/item/gun/energy/e_gun/empty_cell - dead_cell = TRUE + spawn_no_ammo = TRUE /obj/item/gun/energy/e_gun/mini name = "miniature energy gun" @@ -36,7 +36,7 @@ spread_unwielded = 5 /obj/item/gun/energy/e_gun/mini/empty_cell - dead_cell = TRUE + spawn_no_ammo = TRUE /obj/item/gun/energy/e_gun/hades name = "SL AL-655 'Hades' energy rifle" diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 68c7be0312eb..f5f82ff43fb9 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -16,7 +16,7 @@ spread_unwielded = 10 /obj/item/gun/energy/laser/empty_cell - dead_cell = TRUE + spawn_no_ammo = TRUE /obj/item/gun/energy/laser/practice name = "practice laser gun" diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 8cf0cabe22b5..8655649a76aa 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -16,7 +16,7 @@ return /obj/item/gun/energy/ionrifle/empty_cell - dead_cell = TRUE + spawn_no_ammo = TRUE /obj/item/gun/energy/ionrifle/carbine name = "ion carbine" diff --git a/code/modules/projectiles/guns/manufacturer/etherbor/energy_gunsword.dm b/code/modules/projectiles/guns/manufacturer/etherbor/energy_gunsword.dm index 30442e290ac4..a0bbb7185621 100644 --- a/code/modules/projectiles/guns/manufacturer/etherbor/energy_gunsword.dm +++ b/code/modules/projectiles/guns/manufacturer/etherbor/energy_gunsword.dm @@ -46,7 +46,7 @@ armour_penetration = -10 /obj/item/gun/energy/kalix/empty_cell - dead_cell = TRUE + spawn_no_ammo = TRUE /obj/item/gun/energy/kalix/pgf name = "Etherbor BG-16" @@ -107,7 +107,7 @@ delay = 0 /obj/item/gun/energy/kalix/pistol/empty_cell - dead_cell = TRUE + spawn_no_ammo = TRUE /obj/item/gun/energy/kalix/pgf/heavy name = "Etherbor HBG-7"