Merge branch 'master' into polaris-sync-2018-02-07

This commit is contained in:
Aronai Sieyes
2018-02-07 23:06:03 -05:00
committed by Arokha Sieyes
43 changed files with 43485 additions and 191 deletions
+17 -12
View File
@@ -59,22 +59,27 @@ SUBSYSTEM_DEF(mapping)
var/list/deffo_load = using_map.lateload_z_levels
var/list/maybe_load = using_map.lateload_single_pick
for(var/mapname in deffo_load)
var/datum/map_template/MT = map_templates[mapname]
if(!istype(MT))
error("Lateload Z level \"[mapname]\" is not a valid map!")
for(var/list/maplist in deffo_load)
if(!islist(maplist))
error("Lateload Z level [maplist] is not a list! Must be in a list!")
continue
MT.load_new_z(centered = FALSE)
CHECK_TICK
for(var/mapname in maplist)
var/datum/map_template/MT = map_templates[mapname]
if(!istype(MT))
error("Lateload Z level \"[mapname]\" is not a valid map!")
continue
MT.load_new_z(centered = FALSE)
CHECK_TICK
if(LAZYLEN(maybe_load))
var/picked = pick(maybe_load)
var/list/picklist
var/picklist = pick(maybe_load)
if(islist(picked)) //So you can have a 'chain' of z-levels that make up one away mission
picklist = picked
else
picklist = list(picked)
if(!picklist) //No lateload maps at all
return
if(!islist(picklist)) //So you can have a 'chain' of z-levels that make up one away mission
error("Randompick Z level [picklist] is not a list! Must be in a list!")
return
for(var/map in picklist)
var/datum/map_template/MT = map_templates[map]
+15 -6
View File
@@ -15,14 +15,24 @@ SUBSYSTEM_DEF(mobs)
var/list/currentrun = list()
var/log_extensively = FALSE
var/list/timelog = list()
var/list/busy_z_levels
var/slept_mobs = 0
/datum/controller/subsystem/mobs/stat_entry()
..("P: [global.mob_list.len]")
..("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()
if(log_extensively) timelog = list("-Start- [TICK_USAGE]")
busy_z_levels = list()
for(var/played_mob in player_list)
if(!played_mob || isobserver(played_mob))
continue
var/mob/pm = played_mob
busy_z_levels |= pm.z
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
@@ -37,11 +47,10 @@ SUBSYSTEM_DEF(mobs)
// 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
var/time_before = TICK_USAGE
if(M.low_priority && !(M.z in busy_z_levels))
slept_mobs++
continue
M.Life(times_fired)
var/time_after = TICK_USAGE
var/time_diff = time_after - time_before
if(log_extensively && (time_diff > 0.01)) timelog += list("[time_diff]% - [M] ([M.x],[M.y],[M.z])" = M)
catch(var/exception/e)
log_runtime(e, M, "Caught by [name] subsystem")