Optimize the volcanoes (#30592)

* Optimize the hell out of volcanoes

* I knew I forgot something when moving stuff around
This commit is contained in:
Vi3trice
2025-10-09 11:14:37 +00:00
committed by GitHub
parent a8a32eea7a
commit 7e4f0a0b0f
@@ -153,15 +153,15 @@
new_river.generate(nodes = 4, ignore_bridges = TRUE, warning = TRUE)
if(world.time >= next_rubble)
next_rubble = world.time + rand(3 DECISECONDS, 2 SECONDS)
var/hits = 0
var/target
for(var/turf/T in get_area_turfs(/area/lavaland/surface/outdoors))
if(istype(get_area(T), /area/lavaland/surface/outdoors/outpost/no_boulder))
for(var/area/lavaland/surface/outdoors/N in GLOB.all_areas)
if(istype(N, /area/lavaland/surface/outdoors/outpost/no_boulder))
continue // No hitting the no boulder area
if(istype(T, /turf/simulated/floor)) // dont waste our time hitting walls
for(var/turf/simulated/floor/T in N) // dont waste our time hitting walls
valid_targets += T
if(isnull(valid_targets)) // prevents a runtime when coding without lavaland enabled. Or theres somehow ZERO turfs.
return
var/hits = 0
var/target
while(hits <= 150 && length(valid_targets)) //sling a bunch of rocks around the map
target = pick(valid_targets)
new /obj/effect/temp_visual/rock_target(target)