Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix prevent belt flare being filled by dump in action leaving no space for flare gun. #4110

Merged
merged 16 commits into from
Aug 20, 2023
1 change: 1 addition & 0 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,7 @@
name = "\improper M276 pattern M82F flare gun holster rig"
desc = "The M276 is the standard load-bearing equipment of the USCM. It consists of a modular belt with various clips. This version is for the M82F flare gun."
storage_slots = 17
storage_holster = TRUE
max_storage_space = 20
icon_state = "m82f_holster"
item_state = "s_marinebelt"
Expand Down
8 changes: 7 additions & 1 deletion code/game/objects/items/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
var/list/content_watchers //list of mobs currently seeing the storage's contents
var/storage_flags = STORAGE_FLAGS_DEFAULT
var/has_gamemode_skin = FALSE ///Whether to use map-variant skins.

var/storage_holster = FALSE
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/storage/MouseDrop(obj/over_object as obj)
if(CAN_PICKUP(usr, src))
Expand Down Expand Up @@ -722,6 +722,10 @@ W is always an item. stop_warning prevents messaging. user may be null.**/
return TRUE

Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
/obj/item/storage/proc/dump_into(obj/item/storage/M, mob/user)
if(storage_holster == TRUE && contents.len >= (storage_slots-1))
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
to_chat(user, SPAN_WARNING("[src] is full."))
return FALSE

if(user.action_busy)
return

Expand All @@ -736,6 +740,8 @@ W is always an item. stop_warning prevents messaging. user may be null.**/
if(!do_after(user, 1.5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC))
return
for(var/obj/item/I in M)
if(storage_holster == TRUE && contents.len >= (storage_slots-1))
break
if(!has_room(I))
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
break
M.remove_from_storage(I)
Expand Down