mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-09 16:12:17 +00:00
[MIRROR] Machine var shim (#11878)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
61146ef685
commit
4099a9435b
@@ -43,11 +43,11 @@
|
||||
locked = !locked
|
||||
to_chat(user, "You [ locked ? "lock" : "unlock"] the device.")
|
||||
if(locked)
|
||||
if(user.machine==src)
|
||||
if(user.check_current_machine(src))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=ai_slipper")
|
||||
else
|
||||
if(user.machine==src)
|
||||
if(user.check_current_machine(src))
|
||||
attack_hand(user)
|
||||
else
|
||||
to_chat(user, span_warning("Access denied."))
|
||||
|
||||
@@ -150,14 +150,12 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/autolathe/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/autolathe/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
ui.user.set_machine(src)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
if(busy)
|
||||
|
||||
@@ -124,7 +124,6 @@
|
||||
/obj/machinery/computer/arcade/battle/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/computer/arcade/battle/tgui_interact(mob/user, datum/tgui/ui)
|
||||
|
||||
@@ -116,7 +116,6 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/cloning/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
add_fingerprint(user)
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
|
||||
@@ -150,7 +150,6 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/computer/guestpass/tgui_interact(mob/user, datum/tgui/ui)
|
||||
|
||||
@@ -260,7 +260,7 @@ var/specops_shuttle_timeleft = 0
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if (temp)
|
||||
dat = temp
|
||||
@@ -279,7 +279,7 @@ var/specops_shuttle_timeleft = 0
|
||||
return 1
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
|
||||
if (href_list["sendtodock"])
|
||||
if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
if(!allowed(user))
|
||||
to_chat(user, span_warning("You don't have the required access to use this console."))
|
||||
return
|
||||
user.set_machine(src)
|
||||
tgui_interact(user)
|
||||
return
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
/obj/machinery/computer/timeclock/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/computer/timeclock/tgui_interact(mob/user, datum/tgui/ui)
|
||||
|
||||
@@ -498,7 +498,6 @@ About the new airlock wires panel:
|
||||
return
|
||||
|
||||
if(p_open)
|
||||
user.set_machine(src)
|
||||
wires.Interact(user)
|
||||
return
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ Just a object used in constructing fire alarms
|
||||
if(user.stat || stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/area/A = get_area(src)
|
||||
ASSERT(isarea(A))
|
||||
var/d1
|
||||
@@ -332,7 +332,7 @@ Just a object used in constructing fire alarms
|
||||
if(usr.stat || stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (isAI(usr)))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if(href_list["reset"])
|
||||
reset()
|
||||
else if(href_list["alarm"])
|
||||
|
||||
@@ -225,13 +225,6 @@ Class Procs:
|
||||
return STATUS_CLOSE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/CouldUseTopic(var/mob/user)
|
||||
..()
|
||||
user.set_machine(src)
|
||||
|
||||
/obj/machinery/CouldNotUseTopic(var/mob/user)
|
||||
user.unset_machine()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/attack_ai(mob/user as mob)
|
||||
|
||||
@@ -51,7 +51,7 @@ GLOBAL_VAR(bomb_set)
|
||||
if(timeleft <= 0)
|
||||
explode()
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if((M.client && M.machine == src))
|
||||
if((M.client && M.check_current_machine(src)))
|
||||
attack_hand(M)
|
||||
return ..()
|
||||
|
||||
@@ -354,7 +354,7 @@ GLOBAL_VAR(bomb_set)
|
||||
|
||||
add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if((M.client && M.machine == src))
|
||||
if((M.client && M.check_current_machine(src)))
|
||||
attack_hand(M)
|
||||
else
|
||||
usr << browse(null, "window=nuclearbomb")
|
||||
|
||||
@@ -142,7 +142,6 @@
|
||||
/obj/machinery/petrification/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/petrification/tgui_interact(mob/user, datum/tgui/ui = null)
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
src.anchored = FALSE
|
||||
src.stat |= MAINT
|
||||
src.unwrenched = 1
|
||||
if (user.machine==src)
|
||||
if (user.check_current_machine(src))
|
||||
user << browse(null, "window=pipedispenser")
|
||||
else /*if (unwrenched==1)*/
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
|
||||
@@ -135,5 +135,5 @@ Please wait until completion...</TT><BR>
|
||||
return
|
||||
|
||||
for (var/mob/M in viewers(1, src))
|
||||
if(M.client && M.machine == src)
|
||||
if(M.client && M.check_current_machine(src))
|
||||
attack_hand(M)
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
user.visible_message(span_notice("[user] [panel_open ? "opens" : "closes"] the hatch on the [src]."), span_notice("You [panel_open ? "open" : "close"] the hatch on the [src]."))
|
||||
update_icon()
|
||||
if(!panel_open && user.machine == src)
|
||||
if(!panel_open && user.check_current_machine(src))
|
||||
user << browse(null, "window=spaceheater")
|
||||
user.unset_machine()
|
||||
else
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
winset(editingcode, "tcscode", "is-disabled=false")
|
||||
|
||||
// If the player's not manning the keyboard anymore, adjust everything
|
||||
if( (!(editingcode in range(1, src)) && !issilicon(editingcode)) || (editingcode.machine != src && !issilicon(editingcode)))
|
||||
if( (!(editingcode in range(1, src)) && !issilicon(editingcode)) || (!editingcode.check_current_machine(src) && !issilicon(editingcode)))
|
||||
if(editingcode)
|
||||
winshow(editingcode, "Telecomms IDE", 0) // hide the window!
|
||||
editingcode = null
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
for(var/mob/M in viewingcode)
|
||||
|
||||
if( (M.machine == src && (M in view(1, src)) ) || issilicon(M))
|
||||
if( (M.check_current_machine(src) && (M in view(1, src)) ) || issilicon(M))
|
||||
winset(M, "tcscode", "is-disabled=true")
|
||||
winset(M, "tcscode", "text=\"[showcode]\"")
|
||||
else
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
var/insistinga = 0
|
||||
|
||||
/obj/machinery/wish_granter/attack_hand(var/mob/living/carbon/human/user as mob)
|
||||
user.set_machine(src)
|
||||
|
||||
if(chargesa <= 0)
|
||||
to_chat(user, span_infoplain("The Wish Granter lies silent."))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user