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
16 changes: 16 additions & 0 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
cant_hold = list(/obj/item/weapon/throwing_knife)
///TRUE Means that it closes a flap over its contents, and therefore update_icon should lift that flap when opened. If it doesn't have _half and _full iconstates, this doesn't matter either way.
var/flap = TRUE
var/holster_gun = FALSE
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/storage/belt/proc/dump_into(obj/item/storage/M, mob/user)
if(holster_gun == FALSE && 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
..()
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/storage/belt/proc/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
if(holster_gun == FALSE && contents.len >= (storage_slots-1))
return FALSE
..()
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/storage/belt/equipped(mob/user, slot)
switch(slot)
Expand Down Expand Up @@ -895,11 +907,14 @@

/obj/item/storage/belt/gun/on_stored_atom_del(atom/movable/AM)
if(!isgun(AM))
holster_gun = FALSE
return
holstered_guns -= AM
holster_gun = TRUE
for(var/slot in holster_slots)
if(AM == holster_slots[slot]["gun"])
holster_slots[slot]["gun"] = null

update_gun_icon(slot)
return

Expand Down Expand Up @@ -1452,6 +1467,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
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
max_storage_space = 20
icon_state = "m82f_holster"
item_state = "s_marinebelt"
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
var/storage_flags = STORAGE_FLAGS_DEFAULT
var/has_gamemode_skin = FALSE ///Whether to use map-variant skins.


/obj/item/storage/MouseDrop(obj/over_object as obj)
if(CAN_PICKUP(usr, src))
if(over_object == usr) // this must come before the screen objects only block
Expand Down Expand Up @@ -722,6 +721,7 @@ 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(user.action_busy)
return

Expand Down
Loading