[MIRROR] Fixes a bunch of harddels that are sourced from player action (#6252)

* Fixes a bunch of harddels that are sourced from player action

* Mirror!

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
This commit is contained in:
SkyratBot
2021-06-11 03:13:33 +01:00
committed by GitHub
co-authored by LemonInTheDark Funce
parent cc5595fddf
commit 6f3b151bb8
165 changed files with 1076 additions and 546 deletions
+12 -4
View File
@@ -17,9 +17,12 @@ GLOBAL_LIST(labor_sheet_values)
/obj/machinery/mineral/labor_claim_console/Initialize()
. = ..()
Radio = new/obj/item/radio(src)
Radio = new /obj/item/radio(src)
Radio.listening = FALSE
locate_stacking_machine()
//If we can't find a stacking machine end it all ok?
if(!stacking_machine)
return INITIALIZE_HINT_QDEL
if(!GLOB.labor_sheet_values)
var/sheet_list = list()
@@ -30,6 +33,13 @@ GLOBAL_LIST(labor_sheet_values)
sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value)))
GLOB.labor_sheet_values = sortList(sheet_list, /proc/cmp_sheet_list)
/obj/machinery/mineral/labor_claim_console/Destroy()
QDEL_NULL(Radio)
if(stacking_machine)
stacking_machine.console = null
stacking_machine = null
return ..()
/proc/cmp_sheet_list(list/a, list/b)
return a["value"] - b["value"]
@@ -115,9 +125,7 @@ GLOBAL_LIST(labor_sheet_values)
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if(stacking_machine)
stacking_machine.CONSOLE = src
else
qdel(src)
stacking_machine.console = src
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
if(!(obj_flags & EMAGGED))
@@ -345,6 +345,12 @@
var/obj/item/warp_cube/linked
var/teleporting = FALSE
/obj/item/warp_cube/Destroy()
if(!QDELETED(linked))
qdel(linked)
linked = null
return ..()
/obj/item/warp_cube/attack_self(mob/user)
var/turf/current_location = get_turf(user)
var/area/current_area = current_location.loc
@@ -1136,11 +1142,11 @@
club.update_appearance()
current_charges = clamp(current_charges + 1, 0, max_charges)
holder.update_action_buttons_icon()
owner.update_action_buttons_icon()
if(recharge_sound)
playsound(dashing_item, recharge_sound, 50, TRUE)
to_chat(holder, "<span class='notice'>[src] now has [current_charges]/[max_charges] charges.</span>")
to_chat(owner, "<span class='notice'>[src] now has [current_charges]/[max_charges] charges.</span>")
/obj/item/hierophant_club
name = "hierophant club"
@@ -1176,6 +1182,10 @@
. = ..()
blink = new(src)
/obj/item/hierophant_club/Destroy()
. = ..()
QDEL_NULL(blink)
/obj/item/hierophant_club/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
+13 -5
View File
@@ -16,7 +16,13 @@
. = ..()
machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
machine.console = src
/obj/machinery/mineral/stacking_unit_console/Destroy()
if(machine)
machine.console = null
machine = null
return ..()
/obj/machinery/mineral/stacking_unit_console/multitool_act(mob/living/user, obj/item/I)
if(!multitool_check_buffer(user, I))
@@ -78,7 +84,7 @@
circuit = /obj/item/circuitboard/machine/stacking_machine
input_dir = EAST
output_dir = WEST
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
var/obj/machinery/mineral/stacking_unit_console/console
var/stk_types = list()
var/stk_amt = list()
var/stack_list[0] //Key: Type. Value: Instance of type.
@@ -92,7 +98,9 @@
materials = AddComponent(/datum/component/remote_materials, "stacking", mapload, FALSE, mapload && force_connect)
/obj/machinery/mineral/stacking_machine/Destroy()
CONSOLE = null
if(console)
console.machine = null
console = null
materials = null
return ..()
@@ -105,8 +113,8 @@
/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/multitool/M)
if(istype(M))
if(istype(M.buffer, /obj/machinery/mineral/stacking_unit_console))
CONSOLE = M.buffer
CONSOLE.machine = src
console = M.buffer
console.machine = src
to_chat(user, "<span class='notice'>You link [src] to the console in [M]'s buffer.</span>")
return TRUE