Add some helpers for turf translations

This commit is contained in:
Aronai Sieyes
2021-08-04 17:15:07 -04:00
parent ccb1495146
commit dcb3214f4b
2 changed files with 20 additions and 2 deletions
+6 -2
View File
@@ -104,6 +104,9 @@
//Are we doing shuttlework? Just to save another type check later.
var/shuttlework = 0
T.pre_translate_A(B)
B.pre_translate_B(T)
//Shuttle turfs handle their own fancy moving.
if(istype(T,/turf/simulated/shuttle))
shuttlework = 1
@@ -116,7 +119,6 @@
var/old_dir1 = T.dir
var/old_icon_state1 = T.icon_state
var/old_icon1 = T.icon
var/old_underlays = T.underlays.Copy()
var/old_decals = T.decals ? T.decals.Copy() : null
X = B.ChangeTurf(T.type)
@@ -124,7 +126,6 @@
X.icon_state = old_icon_state1
X.icon = old_icon1
X.copy_overlays(T, TRUE)
X.underlays = old_underlays
X.decals = old_decals
//Move the air from source to dest
@@ -164,6 +165,9 @@
else
T.ChangeTurf(get_base_turf_by_area(T))
T.post_translate_A(B)
B.post_translate_B(T)
return TRUE
//Used for border objects. This returns true if this atom is on the border between the two specified turfs
+14
View File
@@ -394,3 +394,17 @@
ChangeTurf(/turf/simulated/floor/airless, preserve_outdoors = TRUE)
return TRUE
return FALSE
// We're about to be the A-side in a turf translation
/turf/proc/pre_translate_A(var/turf/B)
return
// We're about to be the B-side in a turf translation
/turf/proc/pre_translate_B(var/turf/A)
return
// We were the the A-side in a turf translation
/turf/proc/post_translate_A(var/turf/B)
return
// We were the the B-side in a turf translation
/turf/proc/post_translate_B(var/turf/A)
return