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

[MIRROR] Fix holster belts not holstering on click #1644

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions code/game/objects/items/weapons/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@
. = ..()
set_extension(src, /datum/extension/holster, src, sound_in, sound_out, can_holster)

/obj/item/storage/belt/holster/attackby(obj/item/W as obj, mob/user as mob)
var/datum/extension/holster/H = get_extension(src, /datum/extension/holster)
if(H.holster(W, user))
return
else
. = ..(W, user)
/obj/item/storage/belt/holster/use_tool(obj/item/tool, mob/living/user, list/click_params)
// Holster
var/datum/extension/holster/holster = get_extension(src, /datum/extension/holster)
if (holster.can_holster(tool) && holster.holster(tool, user))
return TRUE

return ..()

/obj/item/storage/belt/holster/attack_hand(mob/user as mob)
var/datum/extension/holster/H = get_extension(src, /datum/extension/holster)
Expand Down
2 changes: 1 addition & 1 deletion test/check-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ exactly 0 "simulated = 0/1" 'simulated\s*=\s*\d' -P
exactly 2 "var/ in proc arguments" '(^/[^/].+/.+?\(.*?)var/' -P
exactly 0 "tmp/ vars" 'var.*/tmp/' -P
exactly 7 "uses of .len" '\.len\b' -P
exactly 376 "attackby() override" '\/attackby\((.*)\)' -P
exactly 375 "attackby() override" '\/attackby\((.*)\)' -P
exactly 15 "uses of examine()" '[.|\s]examine\(' -P # If this fails it's likely because you used '/atom/proc/examine(mob)' instead of '/proc/examinate(mob, atom)' - Exception: An examine()-proc may call other examine()-procs
exactly 7 "direct modifications of overlays list" '\boverlays((\s*[|^=+&-])|(\.(Cut)|(Add)|(Copy)|(Remove)|(Remove)))' -P
exactly 0 "new/list list instantiations" 'new\s*/list' -P
Expand Down