Sleep AI processing when nobody on their Zlevel

This commit is contained in:
Aronai Sieyes
2020-05-17 10:00:14 -04:00
parent 190e8bdd5a
commit 0bad4363b8
6 changed files with 39 additions and 5 deletions

View File

@@ -648,9 +648,14 @@ proc/establish_old_db_connection()
/world/proc/max_z_changed()
if(!istype(GLOB.players_by_zlevel, /list))
GLOB.players_by_zlevel = new /list(world.maxz, 0)
GLOB.living_players_by_zlevel = new /list(world.maxz, 0)
while(GLOB.players_by_zlevel.len < world.maxz)
GLOB.players_by_zlevel.len++
GLOB.players_by_zlevel[GLOB.players_by_zlevel.len] = list()
GLOB.living_players_by_zlevel.len++
GLOB.living_players_by_zlevel[GLOB.living_players_by_zlevel.len] = list()
// Call this to make a new blank z-level, don't modify maxz directly.
/world/proc/increment_max_z()