From 6eeb6a15042f7aa6bc641d6374fe155ab1bb3934 Mon Sep 17 00:00:00 2001
From: Dragonkiller93 <82484852+Dragonkiller93@users.noreply.github.com>
Date: Wed, 9 Mar 2022 05:13:22 -0800
Subject: [PATCH] Borg locker verb fix. (#17408)
---
.../structures/crates_lockers/closets.dm | 6 +-
.../closets/secure/secure_closets.dm | 6 +-
.../structures/crates_lockers/crates.dm | 64 +++++++++----------
3 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index c055d66b540..9f8217c8c65 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -292,11 +292,11 @@
if(usr.incapacitated())
return
- if(ishuman(usr))
+ if(ishuman(usr) || isrobot(usr))
add_fingerprint(usr)
toggle(usr)
- else
- to_chat(usr, "This mob type can't use this verb.")
+ return
+ to_chat(usr, "This mob type can't use this verb.")
/obj/structure/closet/update_icon()//Putting the welded stuff in updateicon() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
if(!opened)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
index 8965c3f7361..55ad93a743d 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
@@ -90,11 +90,11 @@
if(usr.incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
- if(ishuman(usr))
+ if(ishuman(usr)||isrobot(usr))
add_fingerprint(usr)
togglelock(usr)
- else
- to_chat(usr, "This mob type can't use this verb.")
+ return
+ to_chat(usr, "This mob type can't use this verb.")
/obj/structure/closet/secure_closet/update_overlays() //Putting the welded stuff in update_overlays() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
cut_overlays()
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index 9cb6ab33536..1b996632e31 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -28,9 +28,9 @@
return TRUE
/obj/structure/closet/crate/open(by_hand = FALSE)
- if(src.opened)
+ if(opened)
return FALSE
- if(!src.can_open())
+ if(!can_open())
return FALSE
if(by_hand)
@@ -54,7 +54,7 @@
for(var/mob/M in src) //Mobs
M.forceMove(loc)
icon_state = icon_opened
- src.opened = TRUE
+ opened = TRUE
if(climbable)
structure_shaken()
@@ -62,9 +62,9 @@
return TRUE
/obj/structure/closet/crate/close()
- if(!src.opened)
+ if(!opened)
return FALSE
- if(!src.can_close())
+ if(!can_close())
return FALSE
playsound(loc, close_sound, close_sound_volume, TRUE, -3)
@@ -82,7 +82,7 @@
itemcount++
icon_state = icon_closed
- src.opened = FALSE
+ opened = FALSE
return TRUE
/obj/structure/closet/crate/attackby(obj/item/W, mob/user, params)
@@ -133,7 +133,7 @@
/obj/structure/closet/crate/attack_hand(mob/user)
if(manifest)
to_chat(user, "You tear the manifest off of the crate.")
- playsound(src.loc, 'sound/items/poster_ripped.ogg', 75, 1)
+ playsound(loc, 'sound/items/poster_ripped.ogg', 75, TRUE)
manifest.forceMove(loc)
if(ishuman(user))
user.put_in_hands(manifest)
@@ -147,15 +147,15 @@
if(L.electrocute_act(17, src))
do_sparks(5, 1, src)
return
- src.add_fingerprint(user)
- src.toggle(user, by_hand = TRUE)
+ add_fingerprint(user)
+ toggle(user, by_hand = TRUE)
// Called when a crate is delivered by MULE at a location, for notifying purposes
/obj/structure/closet/crate/proc/notifyRecipient(destination)
var/list/msg = list("[capitalize(name)] has arrived at [destination].")
if(destination in announce_beacons)
for(var/obj/machinery/requests_console/D in GLOB.allRequestConsoles)
- if(D.department in src.announce_beacons[destination])
+ if(D.department in announce_beacons[destination])
D.createMessage(name, "Your Crate has Arrived!", msg, 1)
/obj/structure/closet/crate/secure
@@ -208,14 +208,14 @@
return !locked
/obj/structure/closet/crate/secure/proc/togglelock(mob/user)
- if(src.opened)
+ if(opened)
to_chat(user, "Close the crate first.")
return
- if(src.broken)
+ if(broken)
to_chat(user, "The crate appears to be broken.")
return
- if(src.allowed(user))
- src.locked = !src.locked
+ if(allowed(user))
+ locked = !locked
visible_message("The crate has been [locked ? null : "un"]locked by [user].")
update_icon()
else
@@ -229,16 +229,16 @@
if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
- if(ishuman(usr))
- src.add_fingerprint(usr)
- src.togglelock(usr)
- else
- to_chat(usr, "This mob type can't use this verb.")
+ if(ishuman(usr) || isrobot(usr))
+ add_fingerprint(usr)
+ togglelock(usr)
+ return
+ to_chat(usr, "This mob type can't use this verb.")
/obj/structure/closet/crate/secure/attack_hand(mob/user)
if(manifest)
to_chat(user, "You tear the manifest off of the crate.")
- playsound(src.loc, 'sound/items/poster_ripped.ogg', 75, 1)
+ playsound(loc, 'sound/items/poster_ripped.ogg', 75, 1)
manifest.forceMove(loc)
if(ishuman(user))
user.put_in_hands(manifest)
@@ -246,9 +246,9 @@
update_icon()
return
if(locked)
- src.togglelock(user)
+ togglelock(user)
else
- src.toggle(user, by_hand = TRUE)
+ toggle(user, by_hand = TRUE)
/obj/structure/closet/crate/secure/closed_item_click(mob/user)
togglelock(user)
@@ -258,8 +258,8 @@
overlays += sparks
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
playsound(src.loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
- src.locked = 0
- src.broken = 1
+ locked = FALSE
+ broken = TRUE
update_icon()
to_chat(user, "You unlock \the [src].")
@@ -268,19 +268,19 @@
O.emp_act(severity)
if(!broken && !opened && prob(50/severity))
if(!locked)
- src.locked = 1
+ locked = TRUE
else
overlays += sparks
spawn(6) overlays -= sparks //Tried lots of stuff but nothing works right. so i have to use this *sadface*
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
- src.locked = 0
+ locked = FALSE
update_icon()
if(!opened && prob(20/severity))
if(!locked)
open()
else
- src.req_access = list()
- src.req_access += pick(get_all_accesses())
+ req_access = list()
+ req_access += pick(get_all_accesses())
..()
/obj/structure/closet/crate/plastic
@@ -457,7 +457,7 @@
. = ..()
if(.)//we can hold up to one large item
var/found = 0
- for(var/obj/structure/S in src.loc)
+ for(var/obj/structure/S in loc)
if(S == src)
continue
if(!S.anchored)
@@ -465,7 +465,7 @@
S.forceMove(src)
break
if(!found)
- for(var/obj/machinery/M in src.loc)
+ for(var/obj/machinery/M in loc)
if(!M.anchored)
M.forceMove(src)
break
@@ -483,7 +483,7 @@
. = ..()
if(.)//we can hold up to one large item
var/found = 0
- for(var/obj/structure/S in src.loc)
+ for(var/obj/structure/S in loc)
if(S == src)
continue
if(!S.anchored)
@@ -491,7 +491,7 @@
S.forceMove(src)
break
if(!found)
- for(var/obj/machinery/M in src.loc)
+ for(var/obj/machinery/M in loc)
if(!M.anchored)
M.forceMove(src)
break