Removes all locate() calls in block() (#25772)

* Removes all `locate()` calls in `block()`

* Maybe actually push fixes

* Revert bad merge master

* Forgot this one

* Maybe actually push fixes

---------

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
DGamerL
2024-06-28 20:33:38 +00:00
committed by GitHub
parent 02759bcb31
commit efd6f2dfa6
18 changed files with 33 additions and 34 deletions
@@ -159,7 +159,7 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new())
CRASH("Bad Map bounds in [fname], Min x: [bounds[MAP_MINX]], Min y: [bounds[MAP_MINY]], Min z: [bounds[MAP_MINZ]], Max x: [bounds[MAP_MAXX]], Max y: [bounds[MAP_MAXY]], Max z: [bounds[MAP_MAXZ]]")
else
if(!measureOnly)
for(var/t in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])))
for(var/t in block(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ], bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))
var/turf/T = t
// we do this after we load everything in. if we don't; we'll have weird atmos bugs regarding atmos adjacent turfs
T.AfterChange(TRUE, keep_cabling = TRUE)
+1 -1
View File
@@ -30,7 +30,7 @@
/proc/empty_rect(low_x,low_y, hi_x,hi_y, z)
var/timer = start_watch()
log_debug("Emptying region: ([low_x], [low_y]) to ([hi_x], [hi_y]) on z '[z]'")
empty_region(block(locate(low_x, low_y, z), locate(hi_x, hi_y, z)))
empty_region(block(low_x, low_y, z, hi_x, hi_y, z))
log_debug("Took [stop_watch(timer)]s")
/proc/empty_region(list/turfs)
+1 -1
View File
@@ -361,7 +361,7 @@
/mob/camera/blob/proc/rally_spores(turf/T)
to_chat(src, "You rally your spores.")
var/list/surrounding_turfs = block(locate(T.x - 1, T.y - 1, T.z), locate(T.x + 1, T.y + 1, T.z))
var/list/surrounding_turfs = block(T.x - 1, T.y - 1, T.z, T.x + 1, T.y + 1, T.z)
if(!length(surrounding_turfs))
return
@@ -154,7 +154,7 @@
for(var/obj/machinery/camera/c in urange(half_chunk + CAMERA_VIEW_DISTANCE, locate(x + half_chunk, y + half_chunk, z)))
add_camera(c)
for(var/turf/t in block(locate(max(x, 1), max(y, 1), max(z, 1)), locate(min(x + CAMERA_CHUNK_SIZE - 1, world.maxx), min(y + CAMERA_CHUNK_SIZE - 1, world.maxy), z)))
for(var/turf/t in block(max(x, 1), max(y, 1), max(z, 1), min(x + CAMERA_CHUNK_SIZE - 1, world.maxx), min(y + CAMERA_CHUNK_SIZE - 1, world.maxy), z))
turfs[t] = t
for(var/obj/machinery/camera/c as anything in active_cameras)
+1 -1
View File
@@ -123,7 +123,7 @@ GLOBAL_LIST_EMPTY(gravity_generators)
/obj/machinery/gravity_generator/main/proc/setup_parts()
var/turf/our_turf = get_turf(src)
// 9x9 block obtained from the bottom left of the block
var/list/spawn_turfs = block(locate(our_turf.x + 2, our_turf.y + 2, our_turf.z), locate(our_turf.x, our_turf.y, our_turf.z))
var/list/spawn_turfs = block(our_turf.x + 2, our_turf.y + 2, our_turf.z, our_turf.x, our_turf.y, our_turf.z)
var/count = 10
for(var/turf/T in spawn_turfs)
count--
+4 -4
View File
@@ -425,13 +425,13 @@
var/list/L2 = list()
switch(destination.dir)
if(NORTH)
L2 = block(locate(destination.x-9, destination.y+36, destination.z), locate(destination.x+9, 255, destination.z))
L2 = block(destination.x-9, destination.y+36, destination.z, destination.x+9, 255, destination.z)
if(SOUTH)
L2 = block(locate(destination.x-9, 1, destination.z), locate(destination.x+9, destination.y-36, destination.z))
L2 = block(destination.x-9, 1, destination.z, destination.x+9, destination.y-36, destination.z)
if(EAST)
L2 = block(locate(destination.x+36, destination.y-9, destination.z), locate(255, destination.y+9, destination.z))
L2 = block(destination.x+36, destination.y-9, destination.z, 255, destination.y+9, destination.z)
if(WEST)
L2 = block(locate(1, destination.y-9, destination.z), locate(destination.x-36, destination.y+9, destination.z))
L2 = block(1, destination.y-9, destination.z, destination.x-36, destination.y+9, destination.z)
create_lance_ripples(L2, destination)
switch(mode)
@@ -64,13 +64,13 @@
var/list/L2 = list()
switch(dest_dir)
if(NORTH)
L2 = block(locate(port.x - 9, port.y + 36, port.z), locate(port.x + 9, 255, port.z))
L2 = block(port.x - 9, port.y + 36, port.z, port.x + 9, 255, port.z)
if(SOUTH)
L2 = block(locate(port.x - 9, 1, port.z), locate(port.x + 9, port.y - 36, port.z))
L2 = block(port.x - 9, 1, port.z, port.x + 9, port.y - 36, port.z)
if(EAST)
L2 = block(locate(port.x + 36, port.y - 9, port.z), locate(255, port.y + 9, port.z))
L2 = block(port.x + 36, port.y - 9, port.z, 255, port.y + 9, port.z)
if(WEST)
L2 = block(locate(1, port.y - 9, port.z), locate(port.x - 36, port.y + 9, port.z))
L2 = block(1, port.y - 9, port.z, port.x - 36, port.y + 9, port.z)
for(var/turf/BT in L2)
for(var/obj/Ohno in BT.contents)
if((istype(Ohno, /obj/machinery/atmospherics/supermatter_crystal) || istype(Ohno, /obj/singularity)) && !emagged)
+4 -4
View File
@@ -500,13 +500,13 @@
var/list/L2 = list()
switch(S1.dir)
if(NORTH)
L2 = block(locate(S1.x-9, S1.y+36, S1.z), locate(S1.x+9, 255, S1.z))
L2 = block(S1.x-9, S1.y+36, S1.z, S1.x+9, 255, S1.z)
if(SOUTH)
L2 = block(locate(S1.x-9, 1, S1.z), locate(S1.x+9, S1.y-36, S1.z))
L2 = block(S1.x-9, 1, S1.z, S1.x+9, S1.y-36, S1.z)
if(EAST)
L2 = block(locate(S1.x+36, S1.y-9, S1.z), locate(255, S1.y+9, S1.z))
L2 = block(S1.x+36, S1.y-9, S1.z, 255, S1.y+9, S1.z)
if(WEST)
L2 = block(locate(1, S1.y-9, S1.z), locate(S1.x-36, S1.y+9, S1.z))
L2 = block(1, S1.y-9, S1.z, S1.x-36, S1.y+9, S1.z)
mobile_port.shuttle_smash(L2, S1)
mobile_port.roadkill(L0, L1, S1.dir)
@@ -45,7 +45,7 @@
if(C.zpos != zpos)
return
C.set_occupied(FALSE)
for(var/turf/T in block(locate(C.x, C.y, C.zpos), locate(C.x+C.width-1, C.y+C.height-1, C.zpos)))
for(var/turf/T in block(C.x, C.y, C.zpos, C.x + C.width - 1, C.y + C.height - 1, C.zpos))
for(var/atom/movable/M in T)
if(isobserver(M))
continue
+1 -1
View File
@@ -117,7 +117,7 @@
/datum/space_level/proc/get_turfs()
return block(locate(1, 1, zpos), locate(world.maxx, world.maxy, zpos))
return block(1, 1, zpos, world.maxx, world.maxy, zpos)
/datum/space_level/proc/set_linkage(transition_type)
if(linkage == transition_type)
+1 -1
View File
@@ -33,7 +33,7 @@
test_logs[I] = list()
durations[I] = 0
for(var/turf/T in block(locate(1, 1, z_level), locate(world.maxx, world.maxy, z_level)))
for(var/turf/T in block(1, 1, z_level, world.maxx, world.maxy, z_level))
for(var/datum/map_per_tile_test/test in tests)
if(test.failure_count < MAX_MAP_TEST_FAILURE_COUNT)
var/duration = REALTIMEOFDAY