mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
[NO GBP] Lazy Template Cordoning | Double Runtime Fix (#72709)
## About The Pull Request Adds automatic cordoning to block reservations. Also fixes an issue where ChangeTurf would cause SSicon_smoothing to throw runtimes by calling QUEUE_SMOOTH regardless of initialization completion ## Why It's Good For The Game ## Changelog --------- Signed-off-by: GitHub <noreply@github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,22 @@
|
||||
|
||||
#define TURF_FROM_COORDS_LIST(List) (locate(List[1], List[2], List[3]))
|
||||
|
||||
/// Returns a list of turfs in the rectangle specified by BOTTOM LEFT corner and height/width, checks for being outside the world border for you
|
||||
#define CORNER_BLOCK(corner, width, height) CORNER_BLOCK_OFFSET(corner, width, height, 0, 0)
|
||||
|
||||
/// Returns a list of turfs similar to CORNER_BLOCK but with offsets
|
||||
#define CORNER_BLOCK_OFFSET(corner, width, height, offset_x, offset_y) ((block(locate(corner.x + offset_x, corner.y + offset_y, corner.z), locate(min(corner.x + (width - 1) + offset_x, world.maxx), min(corner.y + (height - 1) + offset_y, world.maxy), corner.z))))
|
||||
|
||||
/// Returns an outline (neighboring turfs) of the given block
|
||||
#define CORNER_OUTLINE(corner, width, height) ( \
|
||||
CORNER_BLOCK_OFFSET(corner, width + 2, 1, -1, -1) + \
|
||||
CORNER_BLOCK_OFFSET(corner, width + 2, 1, -1, height) + \
|
||||
CORNER_BLOCK_OFFSET(corner, 1, height, -1, 0) + \
|
||||
CORNER_BLOCK_OFFSET(corner, 1, height, width, 0))
|
||||
|
||||
/// Returns a list of around us
|
||||
#define TURF_NEIGHBORS(turf) CORNER_BLOCK_OFFSET(turf, 2, 2, -1, -1)
|
||||
|
||||
/// The pipes, disposals, and wires are hidden
|
||||
#define UNDERFLOOR_HIDDEN 0
|
||||
/// The pipes, disposals, and wires are visible but cannot be interacted with
|
||||
|
||||
@@ -416,7 +416,7 @@ DEFINE_BITFIELD(smoothing_junction, list(
|
||||
|
||||
//Icon smoothing helpers
|
||||
/proc/smooth_zlevel(zlevel, now = FALSE)
|
||||
var/list/away_turfs = block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel))
|
||||
var/list/away_turfs = Z_TURFS(zlevel)
|
||||
for(var/turf/turf_to_smooth as anything in away_turfs)
|
||||
if(turf_to_smooth.smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
|
||||
if(now)
|
||||
|
||||
@@ -84,7 +84,9 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
var/turf/center = locate((destination.x + xoffset), (destination.y + yoffset), location.z)//So now, find the new center.
|
||||
|
||||
//Now to find a box from center location and make that our destination.
|
||||
for(var/turf/current_turf in block(locate(center.x + b1xerror, center.y + b1yerror, location.z), locate(center.x + b2xerror, center.y + b2yerror, location.z)))
|
||||
var/width = b2xerror - b1xerror
|
||||
var/height = b2yerror - b1yerror
|
||||
for(var/turf/current_turf as anything in CORNER_BLOCK_OFFSET(center, width, height, b1xerror, b1yerror))
|
||||
if(density_check && current_turf.density)
|
||||
continue//If density was specified.
|
||||
if(closed_turf_check && isclosedturf(current_turf))
|
||||
|
||||
@@ -590,16 +590,24 @@ SUBSYSTEM_DEF(explosions)
|
||||
var/highest_y = our_y + i
|
||||
// top left to one before top right
|
||||
if(highest_y <= max_y)
|
||||
outlist += block(locate(max(lowest_x, 1), highest_y, our_z), locate(min(highest_x - 1, max_x), highest_y, our_z))
|
||||
outlist += block(
|
||||
locate(max(lowest_x, 1), highest_y, our_z),
|
||||
locate(min(highest_x - 1, max_x), highest_y, our_z))
|
||||
// top right to one before bottom right
|
||||
if(highest_x <= max_x)
|
||||
outlist += block(locate(highest_x, min(highest_y, max_y), our_z), locate(highest_x, max(lowest_y + 1, 1), our_z))
|
||||
outlist += block(
|
||||
locate(highest_x, min(highest_y, max_y), our_z),
|
||||
locate(highest_x, max(lowest_y + 1, 1), our_z))
|
||||
// bottom right to one before bottom left
|
||||
if(lowest_y >= 1)
|
||||
outlist += block(locate(min(highest_x, max_x), lowest_y, our_z), locate(max(lowest_x + 1, 1), lowest_y, our_z))
|
||||
outlist += block(
|
||||
locate(min(highest_x, max_x), lowest_y, our_z),
|
||||
locate(max(lowest_x + 1, 1), lowest_y, our_z))
|
||||
// bottom left to one before top left
|
||||
if(lowest_x >= 1)
|
||||
outlist += block(locate(lowest_x, max(lowest_y, 1), our_z), locate(lowest_x, min(highest_y - 1, max_y), our_z))
|
||||
outlist += block(
|
||||
locate(lowest_x, max(lowest_y, 1), our_z),
|
||||
locate(lowest_x, min(highest_y - 1, max_y), our_z))
|
||||
|
||||
return outlist
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ SUBSYSTEM_DEF(minor_mapping)
|
||||
|
||||
var/list/all_turfs
|
||||
for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))
|
||||
all_turfs += block(locate(1,1,z), locate(world.maxx,world.maxy,z))
|
||||
all_turfs += Z_TURFS(z)
|
||||
for(var/turf/open/floor/plating/T in all_turfs)
|
||||
if(T.is_blocked_turf())
|
||||
continue
|
||||
@@ -65,7 +65,7 @@ SUBSYSTEM_DEF(minor_mapping)
|
||||
var/list/suitable = list()
|
||||
|
||||
for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))
|
||||
for(var/turf/detected_turf as anything in block(locate(1,1,z), locate(world.maxx,world.maxy,z)))
|
||||
for(var/turf/detected_turf as anything in Z_TURFS(z))
|
||||
if(isfloorturf(detected_turf) && detected_turf.underfloor_accessibility == UNDERFLOOR_HIDDEN)
|
||||
suitable += detected_turf
|
||||
|
||||
|
||||
@@ -634,7 +634,7 @@ SUBSYSTEM_DEF(spatial_grid)
|
||||
turfs = GLOB.station_turfs
|
||||
|
||||
else
|
||||
turfs = block(locate(1,1,z), locate(world.maxx, world.maxy, z))
|
||||
turfs = Z_TURFS(z)
|
||||
|
||||
for(var/client_to_insert in 0 to insert_clients)
|
||||
var/turf/random_turf = pick(turfs)
|
||||
|
||||
@@ -54,8 +54,7 @@
|
||||
if(!reservation)
|
||||
CRASH("Failed to reserve a block for lazy template: '[key]'")
|
||||
|
||||
var/turf/reservation_bottom_left = coords2turf(reservation.bottom_left_coords)
|
||||
if(!loading.load(reservation_bottom_left))
|
||||
if(!loading.load(coords2turf(reservation.bottom_left_coords)))
|
||||
CRASH("Failed to load lazy template: '[key]'")
|
||||
reservations += reservation
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
grille = 0
|
||||
mach = 0
|
||||
for(var/Z in SSmapping.levels_by_trait(ZTRAIT_STATION))
|
||||
for(var/turf/T in block(locate(1,1,Z), locate(world.maxx,world.maxy,Z)))
|
||||
for(var/turf/T as anything in Z_TURFS(Z))
|
||||
// don't count shuttles since they may have just left
|
||||
if(istype(T.loc, /area/shuttle))
|
||||
continue
|
||||
|
||||
@@ -158,8 +158,9 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
if(thisarea.lighting_effects)
|
||||
new_turf.add_overlay(thisarea.lighting_effects[SSmapping.z_level_to_plane_offset[z] + 1])
|
||||
|
||||
QUEUE_SMOOTH_NEIGHBORS(src)
|
||||
QUEUE_SMOOTH(src)
|
||||
if(flags_1 & INITIALIZED_1) // only queue for smoothing if SSatom initialized us
|
||||
QUEUE_SMOOTH_NEIGHBORS(src)
|
||||
QUEUE_SMOOTH(src)
|
||||
|
||||
return new_turf
|
||||
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
/proc/spawn_rivers(target_z, nodes = 4, turf_type = /turf/open/lava/smooth/lava_land_surface, whitelist_area = /area/lavaland/surface/outdoors/unexplored, min_x = RANDOM_LOWER_X, min_y = RANDOM_LOWER_Y, max_x = RANDOM_UPPER_X, max_y = RANDOM_UPPER_Y)
|
||||
var/list/river_nodes = list()
|
||||
var/num_spawned = 0
|
||||
var/list/possible_locs = block(locate(min_x, min_y, target_z), locate(max_x, max_y, target_z))
|
||||
var/width = max_x - min_x
|
||||
var/height = max_y - min_y
|
||||
var/turf/corner = locate(min_x, min_y, target_z)
|
||||
var/list/possible_locs = CORNER_BLOCK(corner, width, height)
|
||||
while(num_spawned < nodes && possible_locs.len)
|
||||
var/turf/T = pick(possible_locs)
|
||||
var/area/A = get_area(T)
|
||||
|
||||
+6
-2
@@ -369,7 +369,9 @@ GLOBAL_VAR(restart_counter)
|
||||
if(!max_zs_to_load)
|
||||
return
|
||||
var/area/global_area = GLOB.areas_by_type[world.area] // We're guaranteed to be touching the global area, so we'll just do this
|
||||
var/list/to_add = block(locate(old_max + 1, 1, 1), locate(maxx, maxy, max_zs_to_load))
|
||||
var/list/to_add = block(
|
||||
locate(old_max + 1, 1, 1),
|
||||
locate(maxx, maxy, max_zs_to_load))
|
||||
global_area.contained_turfs += to_add
|
||||
|
||||
/world/proc/increaseMaxY(new_maxy, max_zs_to_load = maxz)
|
||||
@@ -380,7 +382,9 @@ GLOBAL_VAR(restart_counter)
|
||||
if(!max_zs_to_load)
|
||||
return
|
||||
var/area/global_area = GLOB.areas_by_type[world.area] // We're guarenteed to be touching the global area, so we'll just do this
|
||||
var/list/to_add = block(locate(1, old_maxy + 1, 1), locate(maxx, maxy, max_zs_to_load))
|
||||
var/list/to_add = block(
|
||||
locate(1, old_maxy + 1, 1),
|
||||
locate(maxx, maxy, max_zs_to_load))
|
||||
global_area.contained_turfs += to_add
|
||||
|
||||
/world/proc/incrementMaxZ()
|
||||
|
||||
@@ -996,10 +996,6 @@ GLOBAL_PROTECT(admin_verbs_poll)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
if(SSticker.current_state != GAME_STATE_PLAYING)
|
||||
to_chat(usr, span_warning("The game hasnt started yet!"))
|
||||
return
|
||||
|
||||
var/list/choices = LAZY_TEMPLATE_KEY_LIST_ALL()
|
||||
var/choice = tgui_input_list(usr, "Key?", "Lazy Loader", choices)
|
||||
if(!choice)
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
/** Rally spores to a location */
|
||||
/mob/camera/blob/proc/rally_spores(turf/tile)
|
||||
to_chat(src, "You rally your spores.")
|
||||
var/list/surrounding_turfs = block(locate(tile.x - 1, tile.y - 1, tile.z), locate(tile.x + 1, tile.y + 1, tile.z))
|
||||
var/list/surrounding_turfs = TURF_NEIGHBORS(tile)
|
||||
if(!length(surrounding_turfs))
|
||||
return FALSE
|
||||
for(var/mob/living/simple_animal/hostile/blob/blobspore/spore as anything in blob_mobs)
|
||||
|
||||
@@ -431,7 +431,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations)
|
||||
|
||||
cam_background.add_filter("portal_blur", 1, list("type" = "blur", "size" = 0.5))
|
||||
|
||||
vis_contents += block(locate(center_turf.x - 1, center_turf.y - 1, center_turf.z), locate(center_turf.x + 1, center_turf.y + 1, center_turf.z))
|
||||
vis_contents += TURF_NEIGHBORS(center_turf)
|
||||
cam_background.icon_state = "scanline4"
|
||||
cam_background.color = "#adadff"
|
||||
cam_background.alpha = 128
|
||||
|
||||
@@ -157,11 +157,8 @@
|
||||
if((T.y+height) - 1 > world.maxy)
|
||||
return
|
||||
|
||||
var/list/border = block(locate(max(T.x-1, 1), max(T.y-1, 1), T.z),
|
||||
locate(min(T.x+width+1, world.maxx), min(T.y+height+1, world.maxy), T.z))
|
||||
|
||||
// iterate over turfs in the border and clear them from active atmos processing
|
||||
for(var/turf/border_turf as anything in border)
|
||||
for(var/turf/border_turf as anything in CORNER_BLOCK_OFFSET(T, width + 2, height + 2, -1, -1))
|
||||
SSair.remove_from_active(border_turf)
|
||||
for(var/turf/sub_turf as anything in border_turf.atmos_adjacent_turfs)
|
||||
sub_turf.atmos_adjacent_turfs?.Remove(border_turf)
|
||||
@@ -179,6 +176,7 @@
|
||||
parsed.turf_blacklist = turf_blacklist
|
||||
if(!parsed.load(T.x, T.y, T.z, cropMap=TRUE, no_changeturf=(SSatoms.initialized == INITIALIZATION_INSSATOMS), placeOnTop=should_place_on_top))
|
||||
return
|
||||
|
||||
var/list/bounds = parsed.bounds
|
||||
if(!bounds)
|
||||
return
|
||||
|
||||
@@ -280,7 +280,10 @@
|
||||
SSmapping.build_area_turfs(z_index)
|
||||
|
||||
if(!no_changeturf)
|
||||
for(var/turf/T as anything in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])))
|
||||
var/list/turfs = block(
|
||||
locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]),
|
||||
locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))
|
||||
for(var/turf/T as anything in turfs)
|
||||
//we do this after we load everything in. if we don't, we'll have weird atmos bugs regarding atmos adjacent turfs
|
||||
T.AfterChange(CHANGETURF_IGNORE_AIR)
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
//Yes, I'm sorry.
|
||||
/datum/turf_reservation
|
||||
var/list/reserved_turfs = list()
|
||||
var/list/cordon_turfs = list()
|
||||
var/width = 0
|
||||
var/height = 0
|
||||
var/bottom_left_coords[3]
|
||||
var/top_right_coords[3]
|
||||
var/wipe_reservation_on_release = TRUE
|
||||
var/turf_type = /turf/open/space
|
||||
|
||||
/datum/turf_reservation/transit
|
||||
@@ -18,13 +18,47 @@
|
||||
SSmapping.used_turfs -= reserved_turfs
|
||||
reserved_turfs = list()
|
||||
|
||||
for(var/turf/reserved_turf as anything in reserved_copy)
|
||||
var/list/cordon_copy = cordon_turfs.Copy()
|
||||
SSmapping.used_turfs -= cordon_turfs
|
||||
cordon_turfs = list()
|
||||
|
||||
var/release_turfs = reserved_copy + cordon_copy
|
||||
|
||||
for(var/turf/reserved_turf as anything in release_turfs)
|
||||
SEND_SIGNAL(reserved_turf, COMSIG_TURF_RESERVATION_RELEASED, src)
|
||||
|
||||
// Makes the linter happy, even tho we don't await this
|
||||
INVOKE_ASYNC(SSmapping, TYPE_PROC_REF(/datum/controller/subsystem/mapping, reserve_turfs), reserved_copy)
|
||||
INVOKE_ASYNC(SSmapping, TYPE_PROC_REF(/datum/controller/subsystem/mapping, reserve_turfs), release_turfs)
|
||||
|
||||
/// Attempts to calaculate and store a list of turfs around the reservation for cordoning. Returns whether a valid cordon was calculated
|
||||
/datum/turf_reservation/proc/calculate_cordon_turfs(turf/BL, turf/TR)
|
||||
if(BL.x < 2 || BL.y < 2 || TR.x > (world.maxx - 2) || TR.y > (world.maxy - 2))
|
||||
return FALSE // no space for a cordon here
|
||||
|
||||
var/list/possible_turfs = CORNER_OUTLINE(BL, width, height)
|
||||
for(var/turf/cordon_turf as anything in possible_turfs)
|
||||
if(!(cordon_turf.flags_1 & UNUSED_RESERVATION_TURF))
|
||||
return FALSE
|
||||
cordon_turfs = possible_turfs
|
||||
return TRUE
|
||||
|
||||
/// Actually generates the cordon around the reservation, and marking the cordon turfs as reserved
|
||||
/datum/turf_reservation/proc/generate_cordon()
|
||||
for(var/turf/cordon_turf as anything in cordon_turfs)
|
||||
var/area/misc/cordon/cordon_area = GLOB.areas_by_type[/area/misc/cordon] || new
|
||||
var/area/old_area = cordon_turf.loc
|
||||
old_area.turfs_to_uncontain += cordon_turf
|
||||
cordon_area.contained_turfs += cordon_turf
|
||||
cordon_area.contents += cordon_turf
|
||||
cordon_turf.ChangeTurf(/turf/cordon, /turf/cordon)
|
||||
|
||||
cordon_turf.flags_1 &= ~UNUSED_RESERVATION_TURF
|
||||
SSmapping.unused_turfs["[cordon_turf.z]"] -= cordon_turf
|
||||
SSmapping.used_turfs[cordon_turf] = src
|
||||
|
||||
/datum/turf_reservation/proc/Reserve(width, height, zlevel)
|
||||
src.width = width
|
||||
src.height = height
|
||||
if(width > world.maxx || height > world.maxy || width < 1 || height < 1)
|
||||
return FALSE
|
||||
var/list/avail = SSmapping.unused_turfs["[zlevel]"]
|
||||
@@ -51,6 +85,8 @@
|
||||
if(!(checking.flags_1 & UNUSED_RESERVATION_TURF))
|
||||
passing = FALSE
|
||||
break
|
||||
if(passing) // found a potentially valid area, now try to calculate its cordon
|
||||
passing = calculate_cordon_turfs(BL, TR)
|
||||
if(!passing)
|
||||
continue
|
||||
break
|
||||
@@ -65,8 +101,7 @@
|
||||
SSmapping.unused_turfs["[T.z]"] -= T
|
||||
SSmapping.used_turfs[T] = src
|
||||
T.ChangeTurf(turf_type, turf_type)
|
||||
src.width = width
|
||||
src.height = height
|
||||
generate_cordon()
|
||||
return TRUE
|
||||
|
||||
/datum/turf_reservation/New()
|
||||
|
||||
@@ -1943,8 +1943,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
|
||||
if(istransparentturf(front_hole))
|
||||
ceiling = front_hole
|
||||
else
|
||||
var/list/checkturfs = block(locate(x-1,y-1,ceiling.z),locate(x+1,y+1,ceiling.z))-ceiling-front_hole //Try find hole near of us
|
||||
for(var/turf/checkhole in checkturfs)
|
||||
for(var/turf/checkhole in TURF_NEIGHBORS(ceiling))
|
||||
if(istransparentturf(checkhole))
|
||||
ceiling = checkhole
|
||||
break
|
||||
@@ -1992,8 +1991,8 @@ GLOBAL_LIST_EMPTY(fire_appearances)
|
||||
floor = front_hole
|
||||
lower_level = get_step_multiz(front_hole, DOWN)
|
||||
else
|
||||
var/list/checkturfs = block(locate(x-1,y-1,z),locate(x+1,y+1,z))-floor //Try find hole near of us
|
||||
for(var/turf/checkhole in checkturfs)
|
||||
// Try to find a hole near us
|
||||
for(var/turf/checkhole in TURF_NEIGHBORS(floor))
|
||||
if(istransparentturf(checkhole))
|
||||
floor = checkhole
|
||||
lower_level = get_step_multiz(checkhole, DOWN)
|
||||
|
||||
@@ -155,7 +155,8 @@
|
||||
cameras["[z_level]"] = local_cameras
|
||||
|
||||
var/image/mirror_from = GLOB.cameranet.obscured_images[GET_Z_PLANE_OFFSET(z_level) + 1]
|
||||
for(var/turf/lad as anything in block(locate(max(x, 1), max(y, 1), z_level), locate(min(x + CHUNK_SIZE - 1, world.maxx), min(y + CHUNK_SIZE - 1, world.maxy), z_level)))
|
||||
var/turf/chunk_corner = locate(x, y, z_level)
|
||||
for(var/turf/lad as anything in CORNER_BLOCK(chunk_corner, CHUNK_SIZE - 1, CHUNK_SIZE - 1))
|
||||
var/image/our_image = new /image(mirror_from)
|
||||
our_image.loc = lad
|
||||
turfs[lad] = our_image
|
||||
|
||||
@@ -188,25 +188,27 @@
|
||||
var/list/mobs = list()
|
||||
var/blueprints = FALSE
|
||||
var/clone_area = SSmapping.RequestBlockReservation(size_x * 2 + 1, size_y * 2 + 1)
|
||||
for(var/turf/placeholder in block(locate(target_turf.x - size_x, target_turf.y - size_y, target_turf.z), locate(target_turf.x + size_x, target_turf.y + size_y, target_turf.z)))
|
||||
var/turf/T = placeholder
|
||||
while(istype(T, /turf/open/openspace)) //Multi-z photography
|
||||
T = SSmapping.get_turf_below(T)
|
||||
if(!T)
|
||||
|
||||
var/width = size_x * 2
|
||||
var/height = size_y * 2
|
||||
for(var/turf/placeholder as anything in CORNER_BLOCK_OFFSET(target_turf, width, height, -size_x, -size_y))
|
||||
while(istype(placeholder, /turf/open/openspace)) //Multi-z photography
|
||||
placeholder = SSmapping.get_turf_below(placeholder)
|
||||
if(!placeholder)
|
||||
break
|
||||
|
||||
if(T && ((ai_user && GLOB.cameranet.checkTurfVis(placeholder)) || (placeholder in seen)))
|
||||
turfs += T
|
||||
for(var/mob/M in T)
|
||||
if(placeholder && ((ai_user && GLOB.cameranet.checkTurfVis(placeholder)) || (placeholder in seen)))
|
||||
turfs += placeholder
|
||||
for(var/mob/M in placeholder)
|
||||
mobs += M
|
||||
if(locate(/obj/item/areaeditor/blueprints) in T)
|
||||
if(locate(/obj/item/areaeditor/blueprints) in placeholder)
|
||||
blueprints = TRUE
|
||||
for(var/i in mobs)
|
||||
var/mob/M = i
|
||||
mobs_spotted += M
|
||||
if(M.stat == DEAD)
|
||||
dead_spotted += M
|
||||
desc += M.get_photo_description(src)
|
||||
|
||||
for(var/mob/mob as anything in mobs)
|
||||
mobs_spotted += mob
|
||||
if(mob.stat == DEAD)
|
||||
dead_spotted += mob
|
||||
desc += mob.get_photo_description(src)
|
||||
|
||||
var/psize_x = (size_x * 2 + 1) * world.icon_size
|
||||
var/psize_y = (size_y * 2 + 1) * world.icon_size
|
||||
|
||||
@@ -170,7 +170,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 middle of the block
|
||||
var/list/spawn_turfs = block(locate(our_turf.x - 1, our_turf.y + 2, our_turf.z), locate(our_turf.x + 1, our_turf.y, our_turf.z))
|
||||
var/list/spawn_turfs = CORNER_BLOCK(our_turf, 3, 3)
|
||||
var/count = 10
|
||||
for(var/turf/T in spawn_turfs)
|
||||
count--
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
allowAtomsOnSpace = TRUE
|
||||
|
||||
/datum/map_generator_module/reload_station_map/generate()
|
||||
set waitfor = FALSE
|
||||
|
||||
if(!istype(mother, /datum/map_generator/repair/reload_station_map))
|
||||
return
|
||||
var/datum/map_generator/repair/reload_station_map/mother1 = mother
|
||||
@@ -36,18 +38,18 @@
|
||||
|
||||
require_area_resort()
|
||||
|
||||
for(var/L in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], SSmapping.station_start),
|
||||
locate(bounds[MAP_MAXX], bounds[MAP_MAXY], z_offset - 1)))
|
||||
set waitfor = FALSE
|
||||
var/turf/B = L
|
||||
atoms += B
|
||||
for(var/A in B)
|
||||
atoms += A
|
||||
if(istype(A,/obj/structure/cable))
|
||||
cables += A
|
||||
var/list/generation_turfs = block(
|
||||
locate(bounds[MAP_MINX], bounds[MAP_MINY], SSmapping.station_start),
|
||||
locate(bounds[MAP_MAXX], bounds[MAP_MAXY], z_offset - 1))
|
||||
for(var/turf/gen_turf as anything in generation_turfs)
|
||||
atoms += gen_turf
|
||||
for(var/atom in gen_turf)
|
||||
atoms += atom
|
||||
if(istype(atom, /obj/structure/cable))
|
||||
cables += atom
|
||||
continue
|
||||
if(istype(A,/obj/machinery/atmospherics))
|
||||
atmos_machines += A
|
||||
if(istype(atom, /obj/machinery/atmospherics))
|
||||
atmos_machines += atom
|
||||
|
||||
SSatoms.InitializeAtoms(atoms)
|
||||
SSmachines.setup_template_powernets(cables)
|
||||
|
||||
@@ -245,7 +245,9 @@
|
||||
var/gauss_major = 0
|
||||
var/gauss_minor = 0
|
||||
var/gauss_real = 0
|
||||
var/list/turfs = block(locate(x-1,y-1,z),locate(x+1,y+1,z)) //NO MORE DISCS IN WINDOWS
|
||||
|
||||
var/turf/my_turf = get_turf(src)
|
||||
var/list/turfs = TURF_NEIGHBORS(my_turf) //NO MORE DISCS IN WINDOWS
|
||||
while(length(turfs))
|
||||
var/turf/T = pick_n_take(turfs)
|
||||
if(T.is_blocked_turf(TRUE))
|
||||
@@ -253,6 +255,7 @@
|
||||
else
|
||||
dropturf = T
|
||||
break
|
||||
|
||||
if (!dropturf)
|
||||
dropturf = drop_location()
|
||||
gauss_major = (gaussian(major_threshold, std) - negative_cash_offset) //This is the randomized profit value that this experiment has to surpass to unlock a tech.
|
||||
|
||||
@@ -560,7 +560,9 @@
|
||||
unregister()
|
||||
destination = null
|
||||
previous = null
|
||||
QDEL_NULL(assigned_transit) //don't need it where we're goin'!
|
||||
if(!QDELETED(assigned_transit))
|
||||
qdel(assigned_transit, force = TRUE)
|
||||
assigned_transit = null
|
||||
shuttle_areas = null
|
||||
remove_ripples()
|
||||
return ..()
|
||||
|
||||
@@ -105,17 +105,18 @@ GLOBAL_VAR_INIT(bsa_unlock, FALSE)
|
||||
|
||||
/obj/machinery/bsa/middle/proc/has_space()
|
||||
var/cannon_dir = get_cannon_direction()
|
||||
var/x_min
|
||||
var/x_max
|
||||
var/width = 10
|
||||
var/offset
|
||||
switch(cannon_dir)
|
||||
if(EAST)
|
||||
x_min = x - 4 //replace with defines later
|
||||
x_max = x + 6
|
||||
offset = -4
|
||||
if(WEST)
|
||||
x_min = x + 4
|
||||
x_max = x - 6
|
||||
offset = -6
|
||||
else
|
||||
return FALSE
|
||||
|
||||
for(var/turf/T in block(locate(x_min,y-1,z),locate(x_max,y+1,z)))
|
||||
var/turf/base = get_turf(src)
|
||||
for(var/turf/T as anything in CORNER_BLOCK_OFFSET(base, width, 3, offset, -1))
|
||||
if(T.density || isspaceturf(T))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -66,7 +66,7 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests())
|
||||
/datum/unit_test/Destroy()
|
||||
QDEL_LIST(allocated)
|
||||
// clear the test area
|
||||
for (var/turf/turf in block(locate(1, 1, run_loc_floor_bottom_left.z), locate(world.maxx, world.maxy, run_loc_floor_bottom_left.z)))
|
||||
for (var/turf/turf in Z_TURFS(run_loc_floor_bottom_left.z))
|
||||
for (var/content in turf.contents)
|
||||
if (istype(content, /obj/effect/landmark))
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user