mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into lavaland_megafauna
# Conflicts: # code/__DEFINES/misc.dm # code/game/dna/genes/goon_powers.dm # code/game/dna/genes/vg_powers.dm # code/game/objects/effects/overlays.dm # code/game/objects/structures/crates_lockers/closets.dm # code/game/objects/structures/crates_lockers/closets/statue.dm # code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm # icons/mob/back.dmi # icons/obj/storage.dmi
This commit is contained in:
@@ -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,11 +73,17 @@ 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)
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
var/list/irc_bot_host = list()
|
||||
var/main_irc = ""
|
||||
var/admin_irc = ""
|
||||
var/admin_notify_irc = ""
|
||||
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
|
||||
|
||||
var/default_laws = 0 //Controls what laws the AI spawns with.
|
||||
@@ -468,6 +469,9 @@
|
||||
if("admin_irc")
|
||||
config.admin_irc = value
|
||||
|
||||
if("admin_notify_irc")
|
||||
config.admin_notify_irc = value
|
||||
|
||||
if("python_path")
|
||||
if(value)
|
||||
config.python_path = value
|
||||
|
||||
Reference in New Issue
Block a user