Merge branch 'release' of https://github.com/VOREStation/VOREStation into izac-voreupdate

This commit is contained in:
izac112
2020-05-18 16:05:36 +02:00
72 changed files with 3416 additions and 2686 deletions

View File

@@ -193,6 +193,8 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
if (!current_runlevel)
SetRunLevel(RUNLEVEL_LOBBY)
GLOB.revdata = new // It can load revdata now, from tgs or .git or whatever
// Sort subsystems by display setting for easy access.
sortTim(subsystems, /proc/cmp_subsystem_display)
// Set world options.

View File

@@ -9,14 +9,22 @@ SUBSYSTEM_DEF(ai)
var/list/processing = list()
var/list/currentrun = list()
var/slept_mobs = 0
var/list/process_z = list()
/datum/controller/subsystem/ai/stat_entry(msg_prefix)
var/list/msg = list(msg_prefix)
msg += "P:[processing.len]"
..(msg.Join())
..("P: [processing.len] | S: [slept_mobs]")
/datum/controller/subsystem/ai/fire(resumed = 0)
if (!resumed)
src.currentrun = processing.Copy()
process_z.Cut()
slept_mobs = 0
var/level = 1
while(process_z.len < GLOB.living_players_by_zlevel.len)
process_z.len++
process_z[level] = GLOB.living_players_by_zlevel[level].len
level++
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
@@ -26,7 +34,12 @@ SUBSYSTEM_DEF(ai)
--currentrun.len
if(!A || QDELETED(A) || A.busy) // Doesn't exist or won't exist soon or not doing it this tick
continue
A.handle_strategicals()
if(process_z[get_z(A.holder)])
A.handle_strategicals()
else
slept_mobs++
A.set_stance(STANCE_IDLE)
if(MC_TICK_CHECK)
return

View File

@@ -15,24 +15,23 @@ SUBSYSTEM_DEF(mobs)
var/list/currentrun = list()
var/log_extensively = FALSE
var/list/timelog = list()
var/list/busy_z_levels = list()
var/slept_mobs = 0
var/list/process_z = list()
/datum/controller/subsystem/mobs/stat_entry()
..("P: [global.mob_list.len] | S: [slept_mobs]")
/datum/controller/subsystem/mobs/fire(resumed = 0)
var/list/busy_z_levels = src.busy_z_levels
if (!resumed)
slept_mobs = 0
src.currentrun = mob_list.Copy()
busy_z_levels.Cut()
for(var/played_mob in player_list)
if(!played_mob || isobserver(played_mob))
continue
var/mob/pm = played_mob
busy_z_levels |= pm.z
process_z.Cut()
slept_mobs = 0
var/level = 1
while(process_z.len < GLOB.living_players_by_zlevel.len)
process_z.len++
process_z[level] = GLOB.living_players_by_zlevel[level].len
level++
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
@@ -41,18 +40,13 @@ SUBSYSTEM_DEF(mobs)
var/mob/M = currentrun[currentrun.len]
currentrun.len--
if(QDELETED(M))
if(!M || QDELETED(M))
mob_list -= M
else
// Right now mob.Life() is unstable enough I think we need to use a try catch.
// Obviously we should try and get rid of this for performance reasons when we can.
try
if(M.low_priority && !(M.z in busy_z_levels))
slept_mobs++
continue
M.Life(times_fired)
catch(var/exception/e)
log_runtime(e, M, "Caught by [name] subsystem")
else if(M.low_priority && !(process_z[get_z(M)]))
slept_mobs++
continue
M.Life(times_fired)
if (MC_TICK_CHECK)
return

View File

@@ -55,6 +55,10 @@ var/global/datum/controller/subsystem/ticker/ticker
/datum/controller/subsystem/ticker/Initialize()
pregame_timeleft = config.pregame_time
send2mainirc("Server lobby is loaded and open at byond://[config.serverurl ? config.serverurl : (config.server ? config.server : "[world.address]:[world.port]")]")
// Set up the global announcer
GLOB.autospeaker = new (null, null, null, 1)
return ..()
/datum/controller/subsystem/ticker/fire(resumed = FALSE)