mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +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
|
else
|
||||||
log_startup_progress("Not generating vaults - SKIP_VAULT_GENERATION found in config/config.txt")
|
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_secrets() // loops 3 times
|
||||||
make_mining_asteroid_secret()
|
|
||||||
|
|
||||||
//hobo shack generation, one shack will spawn, 1/3 chance of two shacks
|
//hobo shack generation, one shack will spawn, 1/3 chance of two shacks
|
||||||
generate_hoboshack()
|
generate_hoboshack()
|
||||||
|
|||||||
@@ -46,31 +46,27 @@ proc/admin_spawn_room_at_pos()
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/proc/make_mining_asteroid_secret()
|
/proc/make_mining_asteroid_secrets()
|
||||||
var/turf/T = null
|
var/turf/T = null
|
||||||
var/sanity = 0
|
var/sanity = 0
|
||||||
var/list/turfs = null
|
var/list/turfs = null
|
||||||
|
var/area/A = locate(/area/mine/unexplored)
|
||||||
turfs = get_area_turfs(/area/mine/unexplored)
|
turfs = A.contents.Copy()
|
||||||
|
|
||||||
if(!turfs.len)
|
if(!turfs.len)
|
||||||
return 0
|
return 0
|
||||||
|
while(spawned_surprises.len < max_secret_rooms)
|
||||||
while(1)
|
|
||||||
sanity++
|
sanity++
|
||||||
if(sanity > 100)
|
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
|
return 0
|
||||||
|
|
||||||
T=pick(turfs)
|
T=pick(turfs)
|
||||||
|
|
||||||
var/complex_type=pick(mining_surprises)
|
var/complex_type=pick(mining_surprises)
|
||||||
var/mining_surprise/complex = new complex_type
|
var/mining_surprise/complex = new complex_type
|
||||||
|
|
||||||
if(complex.spawn_complex(T))
|
if(complex.spawn_complex(T))
|
||||||
spawned_surprises += complex
|
spawned_surprises += complex
|
||||||
return 1
|
continue
|
||||||
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user