This commit is contained in:
FalseIncarnate
2016-12-29 21:13:00 -05:00
841 changed files with 33426 additions and 30013 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
/datum/controller/process/fast_process/statProcess()
..()
stat(null, "[fast_processing.len] fast machines")
stat(null, "[fast_processing.len] fast processes")
/datum/controller/process/fast_process/doWork()
for(last_object in fast_processing)
+25 -4
View File
@@ -9,6 +9,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
//emergency shuttle stuff
var/obj/docking_port/mobile/emergency/emergency
var/obj/docking_port/mobile/emergency/backup/backup_shuttle
var/emergencyCallTime = 6000 //time taken for emergency shuttle to reach the station when called (in deciseconds)
var/emergencyDockTime = 1800 //time taken for emergency shuttle to leave again once it has docked (in deciseconds)
var/emergencyEscapeTime = 1200 //time taken for emergency shuttle to reach a safe distance after leaving station (in deciseconds)
@@ -49,6 +50,8 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
if(!emergency)
WARNING("No /obj/docking_port/mobile/emergency placed on the map!")
if(!backup_shuttle)
WARNING("No /obj/docking_port/mobile/emergency/backup placed on the map!")
if(!supply)
WARNING("No /obj/docking_port/mobile/supply placed on the map!")
@@ -88,8 +91,17 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
/datum/controller/process/shuttle/proc/requestEvac(mob/user, call_reason)
if(!emergency)
throw EXCEPTION("requestEvac(): There is no emergency shuttle! The game will be unresolvable. This is likely due to a mapping error")
return
WARNING("requestEvac(): There is no emergency shuttle, but the shuttle was called. Using the backup shuttle instead.")
if(!backup_shuttle)
WARNING("requestEvac(): There is no emergency shuttle, or backup shuttle!\
The game will be unresolvable.This is possibly a mapping error, \
more likely a bug with the shuttle \
manipulation system, or badminry. It is possible to manually \
resolve this problem by loading an emergency shuttle template \
manually, and then calling register() on the mobile docking port. \
Good luck.")
return
emergency = backup_shuttle
if(world.time - round_start_time < config.shuttle_refuel_delay)
to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - round_start_time) - config.shuttle_refuel_delay)/600))] minutes before trying again.")
@@ -130,6 +142,14 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
return
// Called when an emergency shuttle mobile docking port is
// destroyed, which will only happen with admin intervention
/datum/controller/process/shuttle/proc/emergencyDeregister()
// When a new emergency shuttle is created, it will override the
// backup shuttle.
emergency = backup_shuttle
/datum/controller/process/shuttle/proc/cancelEvac(mob/user)
if(canRecall())
emergency.cancel(get_area(user))
@@ -194,13 +214,14 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
/datum/controller/process/shuttle/proc/moveShuttle(shuttleId, dockId, timed)
var/obj/docking_port/mobile/M = getShuttle(shuttleId)
var/obj/docking_port/stationary/D = getDock(dockId)
if(!M)
return 1
if(timed)
if(M.request(getDock(dockId)))
if(M.request(D))
return 2
else
if(M.dock(getDock(dockId)))
if(M.dock(D))
return 2
return 0 //dock successful
+21 -8
View File
@@ -6,7 +6,7 @@ var/global/datum/controller/process/timer/timer_master
/datum/controller/process/timer/setup()
name = "timer"
schedule_interval = 5 //every 0.5 seconds
schedule_interval = 1 //every 0.1 seconds--2 server ticks
timer_master = src
log_startup_progress("Timer process starting up.")
@@ -30,7 +30,10 @@ var/global/datum/controller/process/timer/timer_master
/datum/controller/process/timer/proc/runevent(datum/timedevent/event)
set waitfor = 0
if(event.thingToCall)
call(event.thingToCall, event.procToCall)(arglist(event.argList))
if(event.thingToCall == GLOBAL_PROC && istext(event.procToCall))
call("/proc/[event.procToCall]")(arglist(event.argList))
else
call(event.thingToCall, event.procToCall)(arglist(event.argList))
/datum/timedevent
var/thingToCall
@@ -42,8 +45,7 @@ var/global/datum/controller/process/timer/timer_master
var/static/nextid = 1
/datum/timedevent/New()
id = nextid
nextid++
id = nextid++
/datum/timedevent/Destroy()
timer_master.processing_timers -= src
@@ -53,7 +55,7 @@ var/global/datum/controller/process/timer/timer_master
/proc/addtimer(thingToCall, procToCall, wait, unique = FALSE, ...)
if(!timer_master) //can't run timers before the mc has been created
return
if(!thingToCall || !procToCall || wait <= 0)
if(!thingToCall || !procToCall)
return
if(timer_master.disabled)
timer_master.disabled = 0
@@ -71,14 +73,25 @@ var/global/datum/controller/process/timer/timer_master
// Check for dupes if unique = 1.
if(unique)
if(event.hash in timer_master.hashes)
return
var/datum/timedevent/hash_event = timer_master.hashes[event.hash]
if(hash_event)
return hash_event.id
timer_master.hashes[event.hash] = event
if(wait <= 0)
timer_master.runevent(event)
timer_master.hashes -= event.hash
return
// If we are unique (or we're not checking that), add the timer and return the id.
timer_master.processing_timers += event
timer_master.hashes += event.hash
return event.id
/proc/deltimer(id)
if(id == 0)
// No event will correspond to an id of 0 - the timer does not exist
// Save us a possibly expensive iteration through the timer list
// This would probably be more efficient in general if we used an associative list instead
return 0
for(var/datum/timedevent/event in timer_master.processing_timers)
if(event.id == id)
qdel(event)