Skip to content

Commit

Permalink
* Fixed runtimes at init with the previous construction method for fr…
Browse files Browse the repository at this point in the history
…eezers, heaters and cryo cells

* Made engineers less clumsy when rotating machinery (turn at 90° instead of a random direction)
  • Loading branch information
Menshin committed Dec 23, 2014
1 parent a4baf5d commit 42b701b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Pipelines + Other Objects -> Pipe network

return img

/obj/machinery/atmospherics/proc/construction(D, P)
/obj/machinery/atmospherics/construction(D, P)
dir = D
initialize_directions = P
var/turf/T = loc
Expand Down
10 changes: 8 additions & 2 deletions code/game/machinery/Freezer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/obj/machinery/atmospherics/unary/cold_sink/freezer/New()
..()
construction(dir,dir)
initialize_directions = dir
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/thermomachine(null)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
Expand All @@ -21,6 +21,9 @@
component_parts += new /obj/item/stack/cable_coil(null, 1)
RefreshParts()

/obj/machinery/atmospherics/unary/cold_sink/freezer/construction()
..(dir,dir)

/obj/machinery/atmospherics/unary/cold_sink/freezer/RefreshParts()
var/H
var/T
Expand Down Expand Up @@ -127,7 +130,7 @@

/obj/machinery/atmospherics/unary/heat_reservoir/heater/New()
..()
construction(dir,dir)
initialize_directions = dir
var/obj/item/weapon/circuitboard/thermomachine/H = new /obj/item/weapon/circuitboard/thermomachine(null)
H.build_path = /obj/machinery/atmospherics/unary/heat_reservoir/heater
H.name = "circuit board (Heater)"
Expand All @@ -141,6 +144,9 @@
component_parts += new /obj/item/stack/cable_coil(null, 1)
RefreshParts()

/obj/machinery/atmospherics/unary/heat_reservoir/heater/construction()
..(dir,dir)

/obj/machinery/atmospherics/unary/heat_reservoir/heater/RefreshParts()
var/H
var/T
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/constructable_frame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
if(component_check)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
new_machine.construction()
for(var/obj/O in new_machine.component_parts)
qdel(O)
new_machine.component_parts = list()
Expand Down
5 changes: 4 additions & 1 deletion code/game/machinery/cryo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/obj/machinery/atmospherics/unary/cryo_cell/New()
..()
construction(dir,dir)
initialize_directions = dir
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/cryo_tube(null)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
Expand All @@ -28,6 +28,9 @@
component_parts += new /obj/item/stack/cable_coil(null, 1)
RefreshParts()

/obj/machinery/atmospherics/unary/cryo_cell/construction()
..(dir,dir)

/obj/machinery/atmospherics/unary/cryo_cell/RefreshParts()
var/C
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
Expand Down
8 changes: 6 additions & 2 deletions code/game/machinery/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ Class Procs:
/obj/machinery/proc/default_change_direction_wrench(var/mob/user, var/obj/item/weapon/wrench/W)
if(panel_open && istype(W))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
dir = pick(WEST,EAST,SOUTH,NORTH)
user << "<span class='notice'>You clumsily rotate [src].</span>"
dir = turn(dir,-90)
user << "<span class='notice'>You rotate [src].</span>"
return 1
return 0

Expand Down Expand Up @@ -382,3 +382,7 @@ Class Procs:
W.play_rped_sound()
return 1
return 0

//called on machinery construction (i.e from frame to machinery) but not on initialization
/obj/machinery/proc/construction()
return

0 comments on commit 42b701b

Please sign in to comment.