mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
fix mining asteroid secret randomly generated rooms not spawning (#34344)
This commit is contained in:
@@ -27,8 +27,7 @@ var/datum/subsystem/map/SSmap
|
||||
else
|
||||
log_startup_progress("Not generating vaults - SKIP_VAULT_GENERATION found in config/config.txt")
|
||||
|
||||
for(var/i = 0, i < max_secret_rooms, i++)
|
||||
make_mining_asteroid_secret()
|
||||
make_mining_asteroid_secrets() // loops 3 times
|
||||
|
||||
//hobo shack generation, one shack will spawn, 1/3 chance of two shacks
|
||||
generate_hoboshack()
|
||||
|
||||
@@ -46,31 +46,27 @@ proc/admin_spawn_room_at_pos()
|
||||
|
||||
return 1
|
||||
|
||||
/proc/make_mining_asteroid_secret()
|
||||
/proc/make_mining_asteroid_secrets()
|
||||
var/turf/T = null
|
||||
var/sanity = 0
|
||||
var/list/turfs = null
|
||||
|
||||
turfs = get_area_turfs(/area/mine/unexplored)
|
||||
var/area/A = locate(/area/mine/unexplored)
|
||||
turfs = A.contents.Copy()
|
||||
|
||||
if(!turfs.len)
|
||||
return 0
|
||||
|
||||
while(1)
|
||||
while(spawned_surprises.len < max_secret_rooms)
|
||||
sanity++
|
||||
if(sanity > 100)
|
||||
//testing("Tried to place complex too many times. Aborting.")
|
||||
log_debug("Tried to place secret asteroid complex too many times. Aborting.")
|
||||
return 0
|
||||
|
||||
T=pick(turfs)
|
||||
|
||||
var/complex_type=pick(mining_surprises)
|
||||
var/mining_surprise/complex = new complex_type
|
||||
|
||||
if(complex.spawn_complex(T))
|
||||
spawned_surprises += complex
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
continue
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user