fix mining asteroid secret randomly generated rooms not spawning (#34344)

This commit is contained in:
nervere
2023-06-12 11:43:03 -04:00
committed by GitHub
parent 0aa4692bc6
commit 9a2bac935b
2 changed files with 8 additions and 13 deletions

View File

@@ -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()

View File

@@ -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