Fix for solar panels/trackers being wonky.
This commit is contained in:
+13
-14
@@ -24,7 +24,16 @@
|
||||
|
||||
/obj/machinery/power/solar/Initialize(mapload, obj/item/solar_assembly/S)
|
||||
. = ..()
|
||||
Make(S)
|
||||
if(!S)
|
||||
assembly = new /obj/item/solar_assembly
|
||||
assembly.glass_type = new /obj/item/stack/sheet/glass(null, 2)
|
||||
assembly.anchored = TRUE
|
||||
else
|
||||
S.moveToNullspace()
|
||||
assembly = S
|
||||
assembly.glass_type.on_solar_construction(src)
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/solar/Destroy()
|
||||
@@ -45,17 +54,6 @@
|
||||
control.connected_panels.Remove(src)
|
||||
control = null
|
||||
|
||||
/obj/machinery/power/solar/proc/Make(obj/item/solar_assembly/S)
|
||||
if(!S)
|
||||
S = new /obj/item/solar_assembly
|
||||
S.glass_type = new /obj/item/stack/sheet/glass(null, 2)
|
||||
S.anchored = TRUE
|
||||
else
|
||||
S.moveToNullspace()
|
||||
S.glass_type.on_solar_construction(src)
|
||||
obj_integrity = max_integrity
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/solar/crowbar_act(mob/user, obj/item/I)
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
user.visible_message("[user] begins to take the glass off [src].", "<span class='notice'>You begin to take the glass off [src]...</span>")
|
||||
@@ -201,7 +199,7 @@
|
||||
new shard(Tsec)
|
||||
new shard(Tsec)
|
||||
else if(glass_type)
|
||||
forceMove(glass_type, Tsec)
|
||||
glass_type.forceMove(Tsec)
|
||||
glass_type = null
|
||||
|
||||
/obj/item/solar_assembly/attackby(obj/item/W, mob/user, params)
|
||||
@@ -226,7 +224,8 @@
|
||||
var/obj/item/stack/sheet/G = S.change_stack(null, 2)
|
||||
if(G)
|
||||
glass_type = G
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
G.moveToNullspace()
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
user.visible_message("[user] places the glass on the solar assembly.", "<span class='notice'>You place the glass on the solar assembly.</span>")
|
||||
if(tracker)
|
||||
new /obj/machinery/power/tracker(get_turf(src), src)
|
||||
|
||||
@@ -20,7 +20,15 @@
|
||||
|
||||
/obj/machinery/power/tracker/Initialize(mapload, obj/item/solar_assembly/S)
|
||||
. = ..()
|
||||
Make(S)
|
||||
if(!S)
|
||||
assembly = new /obj/item/solar_assembly
|
||||
assembly.glass_type = new /obj/item/stack/sheet/glass(null, 2)
|
||||
assembly.tracker = TRUE
|
||||
assembly.anchored = TRUE
|
||||
else
|
||||
S.moveToNullspace()
|
||||
assembly = S
|
||||
update_icon()
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/tracker/Destroy()
|
||||
@@ -41,16 +49,6 @@
|
||||
control.connected_tracker = null
|
||||
control = null
|
||||
|
||||
/obj/machinery/power/tracker/proc/Make(obj/item/solar_assembly/S)
|
||||
if(!S)
|
||||
S = new /obj/item/solar_assembly
|
||||
S.glass_type = new /obj/item/stack/sheet/glass(null, 2)
|
||||
S.tracker = TRUE
|
||||
S.anchored = TRUE
|
||||
else
|
||||
S.moveToNullspace()
|
||||
update_icon()
|
||||
|
||||
//updates the tracker icon and the facing angle for the control computer
|
||||
/obj/machinery/power/tracker/proc/set_angle(angle)
|
||||
sun_angle = angle
|
||||
|
||||
Reference in New Issue
Block a user