From 72b764546700972ab343d7d87df5aacfb1dbd96d Mon Sep 17 00:00:00 2001
From: Daeberdir <115735095+Daeberdir@users.noreply.github.com>
Date: Thu, 9 Nov 2023 22:03:56 +0200
Subject: [PATCH] bugfix: hotfix #3816 (#3838)
---
_maps/map_files/generic/z2_old.dmm | 24 +++++++++----------
code/datums/outfits/outfit_admin.dm | 2 +-
code/datums/supplypacks.dm | 12 +++++-----
code/modules/projectiles/ammunition/boxes.dm | 12 +++++++---
.../projectiles/guns/projectile/revolver.dm | 2 +-
.../projectiles/guns/projectile/shotgun.dm | 11 +++++----
6 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/_maps/map_files/generic/z2_old.dmm b/_maps/map_files/generic/z2_old.dmm
index 2a8e376e46f..f14e241bd97 100644
--- a/_maps/map_files/generic/z2_old.dmm
+++ b/_maps/map_files/generic/z2_old.dmm
@@ -10998,19 +10998,19 @@
/obj/item/gun/projectile/shotgun/boltaction,
/obj/item/gun/projectile/shotgun/boltaction,
/obj/item/gun/projectile/shotgun/boltaction,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
/obj/item/gun/projectile/shotgun/boltaction,
-/obj/item/ammo_box/a762,
-/obj/item/ammo_box/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
+/obj/item/ammo_box/speedloader/shotgun/a762,
/obj/machinery/light/small{
brightness_range = 10;
light_range = 10;
diff --git a/code/datums/outfits/outfit_admin.dm b/code/datums/outfits/outfit_admin.dm
index 5068b75c7b9..979f9cc5119 100644
--- a/code/datums/outfits/outfit_admin.dm
+++ b/code/datums/outfits/outfit_admin.dm
@@ -744,7 +744,7 @@
backpack_contents = list(
/obj/item/storage/box/soviet = 1,
- /obj/item/ammo_box/a762 = 4
+ /obj/item/ammo_box/speedloader/shotgun/a762 = 4
)
/datum/outfit/admin/soviet/conscript/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm
index 2095f7a07ff..a28605f5c9d 100644
--- a/code/datums/supplypacks.dm
+++ b/code/datums/supplypacks.dm
@@ -578,12 +578,12 @@ GLOBAL_LIST_INIT(all_supply_groups, list(SUPPLY_EMERGENCY,SUPPLY_SECURITY,SUPPLY
name = "Mosin Nagant crate"
contains = list(/obj/item/gun/projectile/shotgun/boltaction,
/obj/item/gun/projectile/shotgun/boltaction,
- /obj/item/ammo_box/a762,
- /obj/item/ammo_box/a762,
- /obj/item/ammo_box/a762,
- /obj/item/ammo_box/a762,
- /obj/item/ammo_box/a762,
- /obj/item/ammo_box/a762)
+ /obj/item/ammo_box/speedloader/shotgun/a762,
+ /obj/item/ammo_box/speedloader/shotgun/a762,
+ /obj/item/ammo_box/speedloader/shotgun/a762,
+ /obj/item/ammo_box/speedloader/shotgun/a762,
+ /obj/item/ammo_box/speedloader/shotgun/a762,
+ /obj/item/ammo_box/speedloader/shotgun/a762)
cost = 80
containername = "Mosin Nagant rifle crate"
contraband = 1
diff --git a/code/modules/projectiles/ammunition/boxes.dm b/code/modules/projectiles/ammunition/boxes.dm
index fded46da5e4..d9d528758e8 100644
--- a/code/modules/projectiles/ammunition/boxes.dm
+++ b/code/modules/projectiles/ammunition/boxes.dm
@@ -8,10 +8,13 @@
icon_state = "357OLD" // see previous entry for explanation of these vars
ammo_type = /obj/item/ammo_casing/a357
max_ammo = 20
- multiple_sprites = 1
+
+/obj/item/ammo_box/a357/update_icon()
+ icon_state = "[initial(icon_state)]-[round(stored_ammo.len / 3)]"
+ desc = "[initial(desc)] There are [stored_ammo.len] shell\s left!"
/obj/item/ammo_box/n762
- name = "ammo box (7.62x38mmR)"
+ name = "ammo box (7.62x38mm)"
icon_state = "riflebox"
origin_tech = "combat=2"
ammo_type = /obj/item/ammo_casing/n762
@@ -23,6 +26,7 @@
icon_state = "slugbox"
ammo_type = /obj/item/ammo_casing/shotgun
max_ammo = 7
+ w_class = WEIGHT_CLASS_NORMAL
/obj/item/ammo_box/shotgun/buck
name = "Ammunition Box (Buckshot)"
@@ -257,10 +261,12 @@
* STRIPPER CLIP
*/
-/obj/item/ammo_box/a762
+/obj/item/ammo_box/speedloader/shotgun/a762
name = "stripper clip (7.62mm)"
desc = "A stripper clip."
icon_state = "762"
+ caliber = "7.62x54mm"
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 5
multiple_sprites = 1
+ w_class = WEIGHT_CLASS_TINY
diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm
index fdcdc4363cc..dae60d512b4 100644
--- a/code/modules/projectiles/guns/projectile/revolver.dm
+++ b/code/modules/projectiles/guns/projectile/revolver.dm
@@ -29,7 +29,7 @@
. = ..()
if(.)
return
- if(istype(A, /obj/item/ammo_box/speedloader))
+ if(istype(A, /obj/item/ammo_box/speedloader) || istype(A, /obj/item/ammo_casing))
var/num_loaded = magazine.attackby(A, user, params, TRUE)
if(num_loaded)
to_chat(user, span_notice("You load [num_loaded] shell\s into \the [src]."))
diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm
index 3e280f4c950..5c4297c12de 100644
--- a/code/modules/projectiles/guns/projectile/shotgun.dm
+++ b/code/modules/projectiles/guns/projectile/shotgun.dm
@@ -18,11 +18,12 @@
. = ..()
if(.)
return
- var/num_loaded = magazine.attackby(A, user, params, 1)
- if(num_loaded)
- to_chat(user, "You load [num_loaded] shell\s into \the [src]!")
- A.update_icon()
- update_icon()
+ if(istype(A, /obj/item/ammo_box/speedloader/shotgun) || istype(A, /obj/item/ammo_casing))
+ var/num_loaded = magazine.attackby(A, user, params, 1)
+ if(num_loaded)
+ to_chat(user, "You load [num_loaded] shell\s into \the [src]!")
+ A.update_icon()
+ update_icon()
/obj/item/gun/projectile/shotgun/process_chamber()