Merge branch 'master' into custom_roundstart_items

This commit is contained in:
kevinz000
2017-08-09 09:46:52 -07:00
1109 changed files with 76579 additions and 76326 deletions
+7 -7
View File
@@ -87,9 +87,8 @@
var/check_randomizer = 0
var/allow_panic_bunker_bounce = 0 //Send new players somewhere else
var/panic_server_name = "somewhere else"
var/panic_address = "byond://" //Reconnect a player this linked server if this server isn't accepting new players
var/panic_server_name
var/panic_address //Reconnect a player this linked server if this server isn't accepting new players
//IP Intel vars
var/ipintel_email
@@ -456,11 +455,12 @@
if("cross_comms_name")
cross_name = value
if("panic_server_name")
panic_server_name = value
if (value != "\[Put the name here\]")
panic_server_name = value
if("panic_server_address")
panic_address = value
if(value != "byond:\\address:port")
allow_panic_bunker_bounce = 1
if(value != "byond://address:port")
panic_address = value
if("medal_hub_address")
global.medal_hub = value
if("medal_hub_password")
+12 -9
View File
@@ -52,15 +52,18 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
/datum/controller/global_vars/Initialize()
gvars_datum_init_order = list()
gvars_datum_protected_varlist = list("gvars_datum_protected_varlist")
//See https://github.com/tgstation/tgstation/issues/26954
for(var/I in typesof(/datum/controller/global_vars/proc))
var/CLEANBOT_RETURNS = "[I]"
pass(CLEANBOT_RETURNS)
for(var/I in vars - gvars_datum_in_built_vars)
var/list/global_procs = typesof(/datum/controller/global_vars/proc)
var/expected_len = vars.len - gvars_datum_in_built_vars.len
if(global_procs.len != expected_len)
warning("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!")
if(global_procs.len)
var/list/expected_global_procs = vars - gvars_datum_in_built_vars
for(var/I in global_procs)
expected_global_procs -= replacetext("[I]", "InitGlobal", "")
log_world("Missing procs: [expected_global_procs.Join(", ")]")
for(var/I in global_procs)
var/start_tick = world.time
call(src, "InitGlobal[I]")()
call(src, I)()
var/end_tick = world.time
if(end_tick - start_tick)
warning("Global [I] slept during initialization!")
warning("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!")
+2 -1
View File
@@ -124,7 +124,8 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
var/FireHim = FALSE
if(istype(BadBoy))
msg = null
switch(++BadBoy.failure_strikes)
LAZYINITLIST(BadBoy.failure_strikes)
switch(++BadBoy.failure_strikes[BadBoy.type])
if(2)
msg = "The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again."
FireHim = TRUE
+1 -1
View File
@@ -31,7 +31,7 @@
var/runlevels = RUNLEVELS_DEFAULT //points of the game at which the SS can fire
var/static/failure_strikes = 0 //How many times we suspect this subsystem has crashed the MC, 3 strikes and you're out!
var/static/list/failure_strikes //How many times we suspect a subsystem type has crashed the MC, 3 strikes and you're out!
//Do not override
/datum/controller/subsystem/New()
-1
View File
@@ -259,7 +259,6 @@ SUBSYSTEM_DEF(blackbox)
/datum/feedback_variable/proc/add_details(text)
if (istext(text))
text = replacetext(text, " ", "_")
if (!details)
details = text
else
+3 -28
View File
@@ -1,11 +1,8 @@
SUBSYSTEM_DEF(disease)
name = "Disease"
flags = SS_KEEP_TIMING|SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
var/list/processing = list()
flags = SS_NO_FIRE
var/list/active_diseases = list() //List of Active disease in all mobs; purely for quick referencing.
var/list/diseases
var/list/archive_diseases = list()
@@ -15,27 +12,5 @@ SUBSYSTEM_DEF(disease)
if(!diseases)
diseases = subtypesof(/datum/disease)
/datum/controller/subsystem/disease/Recover()
currentrun = SSdisease.currentrun
processing = SSdisease.processing
diseases = SSdisease.diseases
archive_diseases = SSdisease.archive_diseases
/datum/controller/subsystem/disease/stat_entry(msg)
..("P:[processing.len]")
/datum/controller/subsystem/disease/fire(resumed = 0)
if(!resumed)
src.currentrun = processing.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/datum/thing = currentrun[currentrun.len]
currentrun.len--
if(thing)
thing.process()
else
processing.Remove(thing)
if (MC_TICK_CHECK)
return
..("P:[active_diseases.len]")
+1 -1
View File
@@ -111,7 +111,7 @@ SUBSYSTEM_DEF(events)
/area/crew_quarters/heads/chief)
//Need to locate() as it's just a list of paths.
return locate(pick((GLOB.the_station_areas - safe_areas) + danger_areas))
return locate(pick((GLOB.the_station_areas - safe_areas) + danger_areas)) in GLOB.sortedAreas
//allows a client to trigger an event
+9 -27
View File
@@ -18,7 +18,7 @@ SUBSYSTEM_DEF(garbage)
// refID's are associated with the time at which they time out and need to be manually del()
// we do this so we aren't constantly locating them and preventing them from being gc'd
var/list/tobequeued = list() //We store the references of things to be added to the queue seperately so we can spread out GC overhead over a few ticks
var/list/tobequeued = list() //We store the references of things to be added to the queue separately so we can spread out GC overhead over a few ticks
var/list/didntgc = list() // list of all types that have failed to GC associated with the number of times that's happened.
// the types are stored as strings
@@ -144,7 +144,7 @@ SUBSYSTEM_DEF(garbage)
queue[refid] = gctime
//this is purely to seperate things profile wise.
//this is purely to separate things profile wise.
/datum/controller/subsystem/garbage/proc/HardDelete(datum/A)
var/time = world.timeofday
var/tick = world.tick_usage
@@ -189,6 +189,7 @@ SUBSYSTEM_DEF(garbage)
SSgarbage.qdel_list += "[D.type]"
#endif
if(isnull(D.gc_destroyed))
D.SendSignal(COMSIG_PARENT_QDELETED)
D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED
var/start_time = world.time
var/hint = D.Destroy(force) // Let our friend know they're about to get fucked up.
@@ -233,25 +234,7 @@ SUBSYSTEM_DEF(garbage)
else if(D.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
CRASH("[D.type] destroy proc was called multiple times, likely due to a qdel loop in the Destroy logic")
// Default implementation of clean-up code.
// This should be overridden to remove all references pointing to the object being destroyed.
// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE.
/datum/proc/Destroy(force=FALSE)
tag = null
var/list/timers = active_timers
active_timers = null
for(var/thing in timers)
var/datum/timedevent/timer = thing
if (timer.spent)
continue
qdel(timer)
return QDEL_HINT_QUEUE
/datum/var/gc_destroyed //Time when this object was destroyed.
#ifdef TESTING
/datum/var/running_find_references
/datum/var/last_find_references = 0
/datum/verb/find_refs()
set category = "Debug"
@@ -300,13 +283,12 @@ SUBSYSTEM_DEF(garbage)
/client/verb/purge_all_destroyed_objects()
set category = "Debug"
if(SSgarbage)
while(SSgarbage.queue.len)
var/datum/o = locate(SSgarbage.queue[1])
if(istype(o) && o.gc_destroyed)
del(o)
SSgarbage.totaldels++
SSgarbage.queue.Cut(1, 2)
while(SSgarbage.queue.len)
var/datum/o = locate(SSgarbage.queue[1])
if(istype(o) && o.gc_destroyed)
del(o)
SSgarbage.totaldels++
SSgarbage.queue.Cut(1, 2)
/datum/verb/qdel_then_find_references()
set category = "Debug"
+2 -3
View File
@@ -217,10 +217,9 @@ SUBSYSTEM_DEF(job)
Debug("Running DO")
//Holder for Triumvirate is stored in the SSticker, this just processes it
if(SSticker)
if(SSticker.triai)
for(var/datum/job/ai/A in occupations)
if(SSticker.triai)
A.spawn_positions = 3
A.spawn_positions = 3
//Get the players who are ready
for(var/mob/dead/new_player/player in GLOB.player_list)
+4 -4
View File
@@ -10,11 +10,11 @@ SUBSYSTEM_DEF(pai)
/datum/controller/subsystem/pai/Topic(href, href_list[])
if(href_list["download"])
var/datum/paiCandidate/candidate = locate(href_list["candidate"])
var/obj/item/device/paicard/card = locate(href_list["device"])
var/datum/paiCandidate/candidate = locate(href_list["candidate"]) in candidates
var/obj/item/device/paicard/card = locate(href_list["device"]) in pai_card_list
if(card.pai)
return
if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate))
if(istype(card, /obj/item/device/paicard) && istype(candidate, /datum/paiCandidate))
if(check_ready(candidate) != candidate)
return FALSE
var/mob/living/silicon/pai/pai = new(card)
@@ -34,7 +34,7 @@ SUBSYSTEM_DEF(pai)
usr << browse(null, "window=findPai")
if(href_list["new"])
var/datum/paiCandidate/candidate = locate(href_list["candidate"])
var/datum/paiCandidate/candidate = locate(href_list["candidate"]) in candidates
var/option = href_list["option"]
var/t = ""
+2 -2
View File
@@ -37,7 +37,7 @@ SUBSYSTEM_DEF(persistence)
var/list/free_satchels = list()
for(var/turf/T in shuffle(block(locate(TRANSITIONEDGE,TRANSITIONEDGE,ZLEVEL_STATION), locate(world.maxx-TRANSITIONEDGE,world.maxy-TRANSITIONEDGE,ZLEVEL_STATION)))) //Nontrivially expensive but it's roundstart only
if(isfloorturf(T) && !istype(T,/turf/open/floor/plating/))
if(isfloorturf(T) && !istype(T, /turf/open/floor/plating/))
free_satchels += new /obj/item/weapon/storage/backpack/satchel/flat/secret(T)
if(!isemptylist(free_satchels) && ((free_satchels.len + placed_satchels) >= (50 - expanded_old_satchels.len) * 0.1)) //up to six tiles, more than enough to kill anything that moves
break
@@ -63,7 +63,7 @@ SUBSYSTEM_DEF(persistence)
F.x = text2num(chosen_satchel[1])
F.y = text2num(chosen_satchel[2])
F.z = ZLEVEL_STATION
if(isfloorturf(F.loc) && !istype(F.loc,/turf/open/floor/plating/))
if(isfloorturf(F.loc) && !istype(F.loc, /turf/open/floor/plating/))
F.hide(1)
new path(F)
return 1
@@ -4,7 +4,7 @@ PROCESSING_SUBSYSTEM_DEF(overlays)
wait = 1
priority = 500
init_order = INIT_ORDER_OVERLAY
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_SETUP
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_SETUP
stat_tag = "Ov"
currentrun = null
+1 -1
View File
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(server_maint)
/datum/controller/subsystem/server_maint/Initialize(timeofday)
if (config.hub)
world.visibility = 1
world.update_hub_visibility(TRUE)
..()
/datum/controller/subsystem/server_maint/fire(resumed = FALSE)
+4 -1
View File
@@ -219,6 +219,9 @@ SUBSYSTEM_DEF(shuttle)
emergency.request(null, signal_origin, html_decode(emergency_reason), 0)
log_game("[key_name(user)] has called the shuttle.")
if(call_reason)
SSblackbox.add_details("shuttle_reason", call_reason)
log_game("Shuttle call reason: [call_reason]")
message_admins("[key_name_admin(user)] has called the shuttle. (<A HREF='?_src_=holder;trigger_centcom_recall=1'>TRIGGER CENTCOM RECALL</A>)")
/datum/controller/subsystem/shuttle/proc/centcom_recall(old_timer, admiral_message)
@@ -540,7 +543,7 @@ SUBSYSTEM_DEF(shuttle)
/datum/controller/subsystem/shuttle/proc/is_in_shuttle_bounds(atom/A)
var/area/current = get_area(A)
if(istype(current, /area/shuttle) && !istype(current,/area/shuttle/transit))
if(istype(current, /area/shuttle) && !istype(current, /area/shuttle/transit))
return TRUE
for(var/obj/docking_port/mobile/M in mobile)
if(M.is_in_shuttle_bounds(A))
+7 -6
View File
@@ -103,7 +103,7 @@ SUBSYSTEM_DEF(throwing)
finalize()
return
/datum/thrownthing/proc/finalize(hit = FALSE)
/datum/thrownthing/proc/finalize(hit = FALSE, target=null)
set waitfor = 0
SSthrowing.processing -= thrownthing
//done throwing, either because it hit something or it finished moving
@@ -120,13 +120,15 @@ SUBSYSTEM_DEF(throwing)
thrownthing.newtonian_move(init_dir)
else
thrownthing.newtonian_move(init_dir)
if(target)
thrownthing.throw_impact(target, src)
if (callback)
callback.Invoke()
/datum/thrownthing/proc/hit_atom(atom/A)
thrownthing.throw_impact(A, src)
thrownthing.newtonian_move(init_dir)
finalize(TRUE)
finalize(hit=TRUE, target=A)
/datum/thrownthing/proc/hitcheck()
for (var/thing in get_turf(thrownthing))
@@ -134,6 +136,5 @@ SUBSYSTEM_DEF(throwing)
if (AM == thrownthing)
continue
if (AM.density && !(AM.pass_flags & LETPASSTHROW) && !(AM.flags & ON_BORDER))
thrownthing.throwing = null
thrownthing.throw_impact(AM, src)
finalize(hit=TRUE, target=AM)
return TRUE
+3 -3
View File
@@ -476,15 +476,15 @@ SUBSYSTEM_DEF(ticker)
if(Player.stat != DEAD && !isbrain(Player))
num_survivors++
if(station_evacuated) //If the shuttle has already left the station
var/area/shuttle_area
var/list/area/shuttle_areas
if(SSshuttle && SSshuttle.emergency)
shuttle_area = SSshuttle.emergency.areaInstance
shuttle_areas = SSshuttle.emergency.shuttle_areas
if(!Player.onCentcom() && !Player.onSyndieBase())
to_chat(Player, "<font color='blue'><b>You managed to survive, but were marooned on [station_name()]...</b></FONT>")
else
num_escapees++
to_chat(Player, "<font color='green'><b>You managed to survive the events on [station_name()] as [Player.real_name].</b></FONT>")
if(get_area(Player) == shuttle_area)
if(shuttle_areas[get_area(Player)])
num_shuttle_escapees++
else
to_chat(Player, "<font color='green'><b>You managed to survive the events on [station_name()] as [Player.real_name].</b></FONT>")
+13 -9
View File
@@ -1,5 +1,6 @@
#define BUCKET_LEN (world.fps*1*60) //how many ticks should we keep in the bucket. (1 minutes worth)
#define BUCKET_POS(timer) (round((timer.timeToRun - SStimer.head_offset) / world.tick_lag) + 1)
#define TIMER_ID_MAX (2**24) //max float with integer precision
SUBSYSTEM_DEF(timer)
name = "Timer"
@@ -209,7 +210,6 @@ SUBSYSTEM_DEF(timer)
timer_id_dict |= SStimer.timer_id_dict
bucket_list |= SStimer.bucket_list
/datum/var/list/active_timers
/datum/timedevent
var/id
var/datum/callback/callBack
@@ -225,18 +225,23 @@ SUBSYSTEM_DEF(timer)
var/static/nextid = 1
/datum/timedevent/New(datum/callback/callBack, timeToRun, flags, hash)
id = nextid++
id = TIMER_ID_NULL
src.callBack = callBack
src.timeToRun = timeToRun
src.flags = flags
src.hash = hash
name = "Timer: [id]: TTR: [timeToRun], Flags: [jointext(bitfield2list(flags, list("TIMER_UNIQUE", "TIMER_OVERRIDE", "TIMER_CLIENT_TIME", "TIMER_STOPPABLE", "TIMER_NO_HASH_WAIT")), ", ")], callBack: \ref[callBack], callBack.object: [callBack.object]\ref[callBack.object]([getcallingtype()]), callBack.delegate:[callBack.delegate]([callBack.arguments ? callBack.arguments.Join(", ") : ""])"
if (flags & TIMER_UNIQUE)
SStimer.hashes[hash] = src
if (flags & TIMER_STOPPABLE)
SStimer.timer_id_dict["timerid[id]"] = src
do
if (nextid >= TIMER_ID_MAX)
nextid = 1
id = nextid++
while(SStimer.timer_id_dict["timerid" + num2text(id, 8)])
SStimer.timer_id_dict["timerid" + num2text(id, 8)] = src
name = "Timer: " + num2text(id, 8) + ", TTR: [timeToRun], Flags: [jointext(bitfield2list(flags, list("TIMER_UNIQUE", "TIMER_OVERRIDE", "TIMER_CLIENT_TIME", "TIMER_STOPPABLE", "TIMER_NO_HASH_WAIT")), ", ")], callBack: \ref[callBack], callBack.object: [callBack.object]\ref[callBack.object]([getcallingtype()]), callBack.delegate:[callBack.delegate]([callBack.arguments ? callBack.arguments.Join(", ") : ""])"
if (callBack.object != GLOBAL_PROC)
LAZYADD(callBack.object.active_timers, src)
@@ -297,7 +302,7 @@ SUBSYSTEM_DEF(timer)
callBack = null
if (flags & TIMER_STOPPABLE)
SStimer.timer_id_dict -= "timerid[id]"
SStimer.timer_id_dict -= "timerid" + num2text(id, 8)
if (flags & TIMER_CLIENT_TIME)
SStimer.clienttime_timers -= src
@@ -378,9 +383,7 @@ SUBSYSTEM_DEF(timer)
timeToRun = REALTIMEOFDAY + wait
var/datum/timedevent/timer = new(callback, timeToRun, flags, hash)
if (flags & TIMER_STOPPABLE)
return timer.id
return TIMER_ID_NULL
return timer.id
/proc/deltimer(id)
if (!id)
@@ -391,6 +394,7 @@ SUBSYSTEM_DEF(timer)
if (istype(id, /datum/timedevent))
qdel(id)
return TRUE
//id is string
var/datum/timedevent/timer = SStimer.timer_id_dict["timerid[id]"]
if (timer && !timer.spent)
qdel(timer)