Fix constructed directional windows leaking atmos, wrap setting of the anchored var on objects (#38934)
* Wrap setting anchored for structures, fix atmos bug * forgot this * Add a signal for setanchored * move setanchored to obj * machinery, also some structure stuff * tabbing
This commit is contained in:
committed by
letterjay
parent
981743a170
commit
417496aa6e
@@ -254,7 +254,7 @@
|
||||
else if(istype(W, /obj/item/wrench) && anchorable)
|
||||
if(isinspace() && !anchored)
|
||||
return
|
||||
anchored = !anchored
|
||||
setAnchored(!anchored)
|
||||
W.play_tool_sound(src, 75)
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You secure the airlock assembly.</span>")
|
||||
name = "secured airlock assembly"
|
||||
anchored = TRUE
|
||||
setAnchored(TRUE)
|
||||
else
|
||||
to_chat(user, "There is another door here!")
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You unsecure the airlock assembly.</span>")
|
||||
name = "airlock assembly"
|
||||
anchored = FALSE
|
||||
setAnchored(FALSE)
|
||||
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && state == AIRLOCK_ASSEMBLY_NEEDS_WIRES && anchored )
|
||||
if(!W.tool_start_check(user, amount=1))
|
||||
@@ -281,7 +281,7 @@
|
||||
target.heat_proof_finished = source.heat_proof_finished
|
||||
target.created_name = source.created_name
|
||||
target.state = source.state
|
||||
target.anchored = source.anchored
|
||||
target.setAnchored(source.anchored)
|
||||
if(previous)
|
||||
target.previous_assembly = source.type
|
||||
if(electronics)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
anchored = !anchored
|
||||
setAnchored(!anchored)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
return FALSE
|
||||
to_chat(user, "<span class='notice'>You construct the window.</span>")
|
||||
var/obj/structure/window/WD = new the_rcd.window_type(drop_location())
|
||||
WD.anchored = TRUE
|
||||
WD.setAnchored(TRUE)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
else if((istype(W, /obj/item/screwdriver)) && (isturf(loc) || anchored))
|
||||
if(!shock(user, 90))
|
||||
W.play_tool_sound(src, 100)
|
||||
anchored = !anchored
|
||||
setAnchored(!anchored)
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] [src].</span>", \
|
||||
"<span class='notice'>You [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor.</span>")
|
||||
return
|
||||
@@ -194,7 +194,7 @@
|
||||
WD = new/obj/structure/window/fulltile(drop_location()) //normal window
|
||||
WD.setDir(dir_to_set)
|
||||
WD.ini_dir = dir_to_set
|
||||
WD.anchored = FALSE
|
||||
WD.setAnchored(FALSE)
|
||||
WD.state = 0
|
||||
ST.use(2)
|
||||
to_chat(user, "<span class='notice'>You place [WD] on [src].</span>")
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/uraction = anchored ? "unscrew [src] from " : "screw [src] to"
|
||||
user.visible_message("<span class='warning'>[user] [action] the floor.</span>", "<span class='notice'>You start to [uraction] the floor...</span>", "You hear rustling noises.")
|
||||
if(W.use_tool(src, user, 100, volume=100, extra_checks = CALLBACK(src, .proc/check_anchored_state, anchored)))
|
||||
anchored = !anchored
|
||||
setAnchored(!anchored)
|
||||
to_chat(user, "<span class='notice'> You [anchored ? "unscrew" : "screw"] [src] from the floor.</span>")
|
||||
return TRUE
|
||||
else
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
"<span class='notice'>You start to weld [src] to the floor...</span>",
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
if (W.use_tool(src, user, 20, volume=50))
|
||||
anchored = TRUE
|
||||
setAnchored(TRUE)
|
||||
to_chat(user, "<span class='notice'>You weld [src] to the floor.</span>")
|
||||
else
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
@@ -127,7 +127,7 @@
|
||||
"<span class='notice'>You start to cut [src] free from the floor...</span>",
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
if (W.use_tool(src, user, 20, volume=50))
|
||||
anchored = FALSE
|
||||
setAnchored(FALSE)
|
||||
to_chat(user, "<span class='notice'>You cut [src] free from the floor.</span>")
|
||||
|
||||
//Finishing the frame
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You secure the windoor assembly.</span>")
|
||||
anchored = TRUE
|
||||
setAnchored(TRUE)
|
||||
if(secure)
|
||||
name = "secure anchored windoor assembly"
|
||||
else
|
||||
@@ -136,7 +136,7 @@
|
||||
if(!anchored)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You unsecure the windoor assembly.</span>")
|
||||
anchored = FALSE
|
||||
setAnchored(FALSE)
|
||||
if(secure)
|
||||
name = "secure windoor assembly"
|
||||
else
|
||||
|
||||
@@ -207,15 +207,12 @@
|
||||
else if(state == WINDOW_OUT_OF_FRAME)
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unscrew the frame from":"screw the frame to"] the floor...</span>")
|
||||
if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_state_and_anchored, state, anchored)))
|
||||
anchored = !anchored
|
||||
update_nearby_icons()
|
||||
setAnchored(!anchored)
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "fasten the frame to":"unfasten the frame from"] the floor.</span>")
|
||||
else //if we're not reinforced, we don't need to check or update state
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unscrew the window from":"screw the window to"] the floor...</span>")
|
||||
if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
|
||||
anchored = !anchored
|
||||
air_update_turf(TRUE)
|
||||
update_nearby_icons()
|
||||
setAnchored(!anchored)
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "fasten the window to":"unfasten the window from"] the floor.</span>")
|
||||
return
|
||||
|
||||
@@ -240,6 +237,11 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/structure/window/setAnchored(anchorvalue)
|
||||
..()
|
||||
air_update_turf(TRUE)
|
||||
update_nearby_icons()
|
||||
|
||||
/obj/structure/window/proc/check_state(checked_state)
|
||||
if(state == checked_state)
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user