Fixes a runtime which bricked the pad plus fixing sprites. Also ports https://github.com/tgstation/tgstation/pull/55533 credit to cacogen.
This commit is contained in:
@@ -251,8 +251,8 @@
|
||||
/obj/machinery/piratepad
|
||||
name = "cargo hold pad"
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "lpad-idle-o"
|
||||
var/idle_state = "lpad-idle-o"
|
||||
icon_state = "lpad-idle-off"
|
||||
var/idle_state = "lpad-idle"
|
||||
var/warmup_state = "lpad-idle"
|
||||
var/sending_state = "lpad-beam"
|
||||
var/cargo_hold_id
|
||||
@@ -296,7 +296,7 @@
|
||||
. = ..()
|
||||
if (istype(I) && istype(I.buffer,/obj/machinery/piratepad))
|
||||
to_chat(user, "<span class='notice'>You link [src] with [I.buffer] in [I] buffer.</span>")
|
||||
pad = I.buffer
|
||||
pad_ref = WEAKREF(I.buffer)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/piratepad_control/LateInitialize()
|
||||
@@ -304,10 +304,11 @@
|
||||
if(cargo_hold_id)
|
||||
for(var/obj/machinery/piratepad/P in GLOB.machines)
|
||||
if(P.cargo_hold_id == cargo_hold_id)
|
||||
pad = P
|
||||
pad_ref = WEAKREF(P)
|
||||
return
|
||||
else
|
||||
pad = locate() in range(4,src)
|
||||
pad_ref = WEAKREF(pad)
|
||||
|
||||
/obj/machinery/computer/piratepad_control/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
@@ -318,7 +319,7 @@
|
||||
/obj/machinery/computer/piratepad_control/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["points"] = points
|
||||
data["pad"] = pad ? TRUE : FALSE
|
||||
data["pad"] = pad_ref?.resolve() ? TRUE : FALSE
|
||||
data["sending"] = sending
|
||||
data["status_report"] = status_report
|
||||
return data
|
||||
@@ -327,7 +328,7 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(!pad)
|
||||
if(!pad_ref?.resolve())
|
||||
return
|
||||
|
||||
switch(action)
|
||||
@@ -348,6 +349,7 @@
|
||||
status_report = "Predicted value: "
|
||||
var/value = 0
|
||||
var/datum/export_report/ex = new
|
||||
var/obj/machinery/piratepad/pad = pad_ref?.resolve()
|
||||
for(var/atom/movable/AM in get_turf(pad))
|
||||
if(AM == pad)
|
||||
continue
|
||||
@@ -366,6 +368,7 @@
|
||||
return
|
||||
|
||||
var/datum/export_report/ex = new
|
||||
var/obj/machinery/piratepad/pad = pad_ref?.resolve()
|
||||
|
||||
for(var/atom/movable/AM in get_turf(pad))
|
||||
if(AM == pad)
|
||||
|
||||
Reference in New Issue
Block a user