Area fixes (#2875)

changes:

Fixes copy_contents_to not working.
Fixes elevators attempting to spawn roofs when it didn't really make sense.
Minor efficiency tweaks in move_contents_to and elevators.
This commit is contained in:
Lohikar
2017-06-30 13:09:19 +03:00
committed by skull132
parent 12ed198d97
commit 84f2ec8105
5 changed files with 12 additions and 18 deletions
+7 -16
View File
@@ -34,8 +34,8 @@
ASSERT(z != -1)
// Now use our information to build an *ordered* list of turfs.
for (var/x = xmin; x <= xmax; x++)
for (var/y = ymin; y <= ymax; y++)
for (var/x = xmin to xmax)
for (var/y = ymin to ymax)
var/turf/T = locate(x, y, z)
if (T.loc != src || T.type == ignore_type)
// Not ours or ignored type, we don't give a crap.
@@ -54,9 +54,7 @@
ASSERT(source_turfs.len == target_turfs.len)
var/list/simulated_turfs = list()
for (var/i = 1; i <= source_turfs.len; i++)
for (var/i = 1 to source_turfs.len)
var/turf/ST = source_turfs[i]
if (!ST) // Excluded turfs are null to keep the list ordered.
continue
@@ -69,15 +67,8 @@
ST.ChangeTurf(ST.baseturf)
if (istype(TT, /turf/simulated))
simulated_turfs += TT
for (var/thing in simulated_turfs)
var/turf/simulated/T = thing
T.update_icon()
if (istype(T.above))
T.above.queue_icon_update()
TT.update_icon()
TT.update_above()
// Called when a movable area wants to move this object.
/atom/movable/proc/shuttle_move(turf/loc)
@@ -108,10 +99,10 @@
baseturf = T.baseturf
for (var/i = 1; i <= source_turfs.len; i++)
for (var/i = 1 to source_turfs.len)
var/turf/ST = source_turfs[i]
var/turf/TTi = target_turfs[i]
if (!ST || (plating_required && TTi.type != baseturf)) // Excluded turfs are null to keep the list ordered.
if (!ST || (plating_required && TTi.type == baseturf)) // Excluded turfs are null to keep the list ordered.
continue
var/turf/TT = ST.copy_turf(TTi, ignore_air = TRUE)
+1
View File
@@ -7,6 +7,7 @@
var/global/global_uid = 0
var/uid
var/holomap_color // Color of this area on the holomap. Must be a hex color (as string) or null.
var/no_roof
/area/Initialize(mapload)
icon_state = "white"
+2 -1
View File
@@ -297,8 +297,9 @@ var/const/enterloopsanity = 100
return FALSE
var/turf/simulated/open/above = GetAbove(src)
var/area/A = loc
if ((istype(above) || (flags & ROOF_FORCE_SPAWN)) && roof_type)
if (((istype(above) && !A.no_roof) || (flags & ROOF_FORCE_SPAWN)) && roof_type && above)
above.ChangeTurf(roof_type)
roof_flags |= flags
return TRUE
@@ -5,6 +5,7 @@
requires_power = 0
station_area = 1
sound_env = SMALL_ENCLOSED
no_roof = TRUE
var/lift_floor_label = null
var/lift_floor_name = null
+1 -1
View File
@@ -128,7 +128,7 @@
for(var/i = 1, i < uz, i++)
lift.floors += null // This silly hack allows lifts to not start on the first zlevel
for(var/cz = uz;cz<=ez;cz++)
for(var/cz = uz to ez)
var/datum/turbolift_floor/cfloor = new()
lift.floors += cfloor