Skip to content

Commit

Permalink
fixes reconstructing heater bug for plasma & combustion and all thrus…
Browse files Browse the repository at this point in the history
…ter machines default to east on construction
  • Loading branch information
Thera-Pissed committed Jun 8, 2024
1 parent fa753bb commit b5c276d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ Class Procs:
for(var/obj/item/I in component_parts)
I.forceMove(loc)
component_parts.Cut()
SEND_SIGNAL(src, COMSIG_OBJ_DECONSTRUCT, disassembled)
qdel(src)

/**
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/shuttle/shuttle_engine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
desc = "A thruster for shuttles."
circuit = /obj/item/circuitboard/machine/shuttle/engine
CanAtmosPass = FALSE //so people can actually tend to their engines
dir = EAST //most ships face east
///Whether or not the engine is enabled and can be used. Controlled from helm consoles and by hitting with a multitool.
var/enabled = TRUE
///How much thrust this engine generates when burned fully.
Expand Down
15 changes: 15 additions & 0 deletions code/game/machinery/shuttle/shuttle_engine_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@
if(!found.anchored)
continue
attached_heater = WEAKREF(found)
var/obj/machinery/atmospherics/components/unary/shuttle/heater/resolved_heater = attached_heater?.resolve()
RegisterSignal(resolved_heater, COMSIG_OBJ_DECONSTRUCT, PROC_REF(remove_heater))
update_icon_state()
return TRUE

/obj/machinery/power/shuttle/engine/fueled/proc/remove_heater(datum/source, disassembled)
SIGNAL_HANDLER

attached_heater = null

/obj/machinery/power/shuttle/engine/fueled/plasma
name = "plasma thruster"
desc = "A thruster that burns plasma from an adjacent heater to create thrust."
Expand Down Expand Up @@ -167,9 +174,16 @@
if(!found.anchored)
continue
attached_heater = WEAKREF(found)
var/obj/machinery/atmospherics/components/unary/shuttle/fire_heater/resolved_heater = attached_heater?.resolve()
RegisterSignal(resolved_heater, COMSIG_OBJ_DECONSTRUCT, PROC_REF(remove_heater))
update_icon_state()
return TRUE

/obj/machinery/power/shuttle/engine/fire/proc/remove_heater(datum/source, disassembled)
SIGNAL_HANDLER

attached_heater = null

/obj/machinery/power/shuttle/engine/fire/RefreshParts()
var/laz = 0
for(var/obj/item/stock_parts/micro_laser/L in component_parts)
Expand Down Expand Up @@ -208,6 +222,7 @@
name = "electric engine precharger"
desc = "A medium-capacity, high transfer superconducting magnetic energy storage unit specially made for use with shuttle engines."
icon = 'icons/obj/shuttle.dmi'
dir = EAST
input_level = 5000
input_level_max = 50000
output_level = 50000
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/shuttle/shuttle_heater.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
desc = "This does something to do with shuttle atmospherics"
icon_state = "heater"
icon = 'icons/obj/shuttle.dmi'
dir = EAST

/obj/machinery/atmospherics/components/unary/shuttle/heater
name = "engine heater"
Expand Down

0 comments on commit b5c276d

Please sign in to comment.