Makes all anchored changes use setAnchored(), COMSIG_MOVABLE_SETANCHORED now only sent if an AM's anchored var has changed for more reliable usage. (#52254)

* Converts everything to use setAnchored() + other fixes

* Fixed singulo debug

* singulo again

* forgot to move the vv_edit proc

* caught that this time :)

* changes

* Update code/game/atoms_movable.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
ShizCalev
2020-07-21 02:20:26 -03:00
committed by GitHub
co-authored by Rohesie
parent 0dcb0c0859
commit 4b6500fb67
77 changed files with 308 additions and 231 deletions
@@ -284,7 +284,7 @@
else if(W.tool_behaviour == TOOL_WRENCH && anchorable)
if(isinspace() && !anchored)
return
setAnchored(!anchored)
set_anchored(!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>", \
+1 -1
View File
@@ -541,7 +541,7 @@
to_chat(user, "<span class='notice'>You unsecure [src].</span>")
else
to_chat(user, "<span class='notice'>You secure [src].</span>")
anchored = !anchored
set_anchored(!anchored)
return
else if(!open && user.a_intent == INTENT_HELP)
to_chat(user, "<span class='notice'>[src] must be open to move it.</span>")
@@ -106,7 +106,7 @@
return
to_chat(user, "<span class='notice'>You secure the airlock assembly.</span>")
name = "secured airlock assembly"
setAnchored(TRUE)
set_anchored(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"
setAnchored(FALSE)
set_anchored(FALSE)
else if(istype(W, /obj/item/stack/cable_coil) && state == AIRLOCK_ASSEMBLY_NEEDS_WIRES && anchored )
if(!W.tool_start_check(user, amount=1))
@@ -295,7 +295,7 @@
target.heat_proof_finished = source.heat_proof_finished
target.created_name = source.created_name
target.state = source.state
target.setAnchored(source.anchored)
target.set_anchored(source.anchored)
if(previous)
target.previous_assembly = source.type
if(electronics)
+1 -1
View File
@@ -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>")
setAnchored(!anchored)
set_anchored(!anchored)
else
return ..()
+3 -3
View File
@@ -67,7 +67,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.setAnchored(TRUE)
WD.set_anchored(TRUE)
return TRUE
return FALSE
@@ -136,7 +136,7 @@
else if((W.tool_behaviour == TOOL_SCREWDRIVER) && (isturf(loc) || anchored))
if(!shock(user, 90))
W.play_tool_sound(src, 100)
setAnchored(!anchored)
set_anchored(!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
@@ -185,7 +185,7 @@
WD = new/obj/structure/window/fulltile(drop_location()) //normal window
WD.setDir(dir_to_set)
WD.ini_dir = dir_to_set
WD.setAnchored(FALSE)
WD.set_anchored(FALSE)
WD.state = 0
ST.use(2)
to_chat(user, "<span class='notice'>You place [WD] on [src].</span>")
@@ -130,7 +130,7 @@
else
return ..()
/obj/structure/mineral_door/setAnchored(anchorvalue) //called in default_unfasten_wrench() chain
/obj/structure/mineral_door/set_anchored(anchorvalue) //called in default_unfasten_wrench() chain
. = ..()
set_opacity(anchored ? !door_opened : FALSE)
air_update_turf(TRUE)
+1 -1
View File
@@ -32,7 +32,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>", "<span class='hear'>You hear rustling noises.</span>")
if(W.use_tool(src, user, 100, volume=100, extra_checks = CALLBACK(src, .proc/check_anchored_state, anchored)))
setAnchored(!anchored)
set_anchored(!anchored)
to_chat(user, "<span class='notice'>You [anchored ? "unscrew" : "screw"] [src] from the floor.</span>")
return TRUE
else
+1 -1
View File
@@ -62,7 +62,7 @@
return
to_chat(user, "<span class='notice'>You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor...</span>")
if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
setAnchored(!anchored)
set_anchored(!anchored)
to_chat(user, "<span class='notice'>You [anchored ? "fasten the railing to":"unfasten the railing from"] the floor.</span>")
return TRUE
+2 -2
View File
@@ -113,7 +113,7 @@
"<span class='notice'>You start to weld [src] to the floor...</span>",
"<span class='hear'>You hear welding.</span>")
if (W.use_tool(src, user, 20, volume=50))
setAnchored(TRUE)
set_anchored(TRUE)
to_chat(user, "<span class='notice'>You weld [src] to the floor.</span>")
else
if(!W.tool_start_check(user, amount=0))
@@ -123,7 +123,7 @@
"<span class='notice'>You start to cut [src] free from the floor...</span>",
"<span class='hear'>You hear welding.</span>")
if (W.use_tool(src, user, 20, volume=50))
setAnchored(FALSE)
set_anchored(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>")
setAnchored(TRUE)
set_anchored(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>")
setAnchored(FALSE)
set_anchored(FALSE)
if(secure)
name = "secure windoor assembly"
else
+4 -4
View File
@@ -180,7 +180,7 @@
if(I.tool_behaviour == TOOL_SCREWDRIVER)
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, volume = 75, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
setAnchored(!anchored)
set_anchored(!anchored)
to_chat(user, "<span class='notice'>You [anchored ? "fasten the window to":"unfasten the window from"] the floor.</span>")
return
else if(I.tool_behaviour == TOOL_WRENCH && !anchored)
@@ -201,7 +201,7 @@
return ..()
/obj/structure/window/setAnchored(anchorvalue)
/obj/structure/window/set_anchored(anchorvalue)
..()
air_update_turf(TRUE)
update_nearby_icons()
@@ -417,7 +417,7 @@
if(I.use_tool(src, user, 40, volume = 50))
to_chat(user, "<span class='notice'>You unscrew the bolts from the frame and the window pops loose.</span>")
state = WINDOW_OUT_OF_FRAME
setAnchored(FALSE)
set_anchored(FALSE)
return
return ..()
@@ -542,7 +542,7 @@
if(I.use_tool(src, user, 50, volume = 50))
to_chat(user, "<span class='notice'>You unfasten the bolts from the frame and the window pops loose.</span>")
state = WINDOW_OUT_OF_FRAME
setAnchored(FALSE)
set_anchored(FALSE)
return
return ..()