mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge branch 'master' into upstream-merge-14976
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
var/discord_ahelps_disabled = 0 //Turn this off if you don't want the TGS bot sending you messages whenever an ahelp ticket is created.
|
||||
var/discord_ahelps_all = 0 //Turn this on if you want all admin-PMs to go to be sent to discord, and not only the first message of a ticket.
|
||||
|
||||
var/list/ip_whitelist = list()
|
||||
|
||||
/hook/startup/proc/read_ch_config()
|
||||
var/list/Lines = file2list("config/config.txt")
|
||||
for(var/t in Lines)
|
||||
@@ -62,4 +64,20 @@
|
||||
config.nodebot_location = value
|
||||
if ("ahelp_channel_tag")
|
||||
config.ahelp_channel_tag = value
|
||||
|
||||
var/list/ip_whitelist_lines = file2list("config/ip_whitelist.txt")
|
||||
var/increment = 1
|
||||
for(var/t in ip_whitelist_lines)
|
||||
if (!t) continue
|
||||
t = trim(t)
|
||||
if (length(t) == 0)
|
||||
continue
|
||||
else if (copytext(t, 1, 2) == "#")
|
||||
continue
|
||||
var/ip_address = splittext(t, ",")
|
||||
for (var/name in ip_address)
|
||||
config.ip_whitelist[name] = increment
|
||||
increment += 1
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
@@ -30,61 +30,86 @@ SUBSYSTEM_DEF(lighting)
|
||||
MC_SPLIT_TICK_INIT(3)
|
||||
if(!init_tick_checks)
|
||||
MC_SPLIT_TICK
|
||||
|
||||
var/list/queue = sources_queue
|
||||
var/i = 0
|
||||
if(length(queue))
|
||||
for(i in 1 to length(queue))
|
||||
var/datum/light_source/L = queue[i]
|
||||
|
||||
L.update_corners()
|
||||
// UPDATE SOURCE QUEUE
|
||||
queue = sources_queue
|
||||
while(i < length(queue)) //we don't use for loop here because i cannot be changed during an iteration
|
||||
i += 1
|
||||
|
||||
var/datum/light_source/L = queue[i]
|
||||
L.update_corners()
|
||||
|
||||
if(!QDELETED(L))
|
||||
L.needs_update = LIGHTING_NO_UPDATE
|
||||
else
|
||||
i -= 1 // update_corners() has removed L from the list, move back so we don't overflow or skip the next element
|
||||
|
||||
if(init_tick_checks)
|
||||
CHECK_TICK
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
// We unroll TICK_CHECK here so we can clear out the queue to ensure any removals/additions when sleeping don't fuck us
|
||||
if(init_tick_checks)
|
||||
if(!TICK_CHECK)
|
||||
continue
|
||||
queue.Cut(1, i + 1)
|
||||
i = 0
|
||||
stoplag()
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
queue.Cut(1, i+1)
|
||||
queue.Cut(1, i + 1)
|
||||
i = 0
|
||||
|
||||
if(!init_tick_checks)
|
||||
MC_SPLIT_TICK
|
||||
|
||||
// UPDATE CORNERS QUEUE
|
||||
queue = corners_queue
|
||||
for (i in 1 to length(queue))
|
||||
var/datum/lighting_corner/C = queue[i]
|
||||
while(i < length(queue)) //we don't use for loop here because i cannot be changed during an iteration
|
||||
i += 1
|
||||
|
||||
var/datum/lighting_corner/C = queue[i]
|
||||
C.needs_update = FALSE //update_objects() can call qdel if the corner is storing no data
|
||||
C.update_objects()
|
||||
|
||||
|
||||
// We unroll TICK_CHECK here so we can clear out the queue to ensure any removals/additions when sleeping don't fuck us
|
||||
if(init_tick_checks)
|
||||
CHECK_TICK
|
||||
if(!TICK_CHECK)
|
||||
continue
|
||||
queue.Cut(1, i + 1)
|
||||
i = 0
|
||||
stoplag()
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
queue.Cut(1, i+1)
|
||||
queue.Cut(1, i + 1)
|
||||
i = 0
|
||||
|
||||
|
||||
if(!init_tick_checks)
|
||||
MC_SPLIT_TICK
|
||||
|
||||
// UPDATE OBJECTS QUEUE
|
||||
queue = objects_queue
|
||||
for (i in 1 to length(queue))
|
||||
var/datum/lighting_object/O = queue[i]
|
||||
while(i < length(queue)) //we don't use for loop here because i cannot be changed during an iteration
|
||||
i += 1
|
||||
|
||||
var/datum/lighting_object/O = queue[i]
|
||||
if (QDELETED(O))
|
||||
continue
|
||||
|
||||
O.update()
|
||||
O.needs_update = FALSE
|
||||
|
||||
// We unroll TICK_CHECK here so we can clear out the queue to ensure any removals/additions when sleeping don't fuck us
|
||||
if(init_tick_checks)
|
||||
CHECK_TICK
|
||||
if(!TICK_CHECK)
|
||||
continue
|
||||
queue.Cut(1, i + 1)
|
||||
i = 0
|
||||
stoplag()
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
queue.Cut(1, i+1)
|
||||
queue.Cut(1, i + 1)
|
||||
|
||||
|
||||
/datum/controller/subsystem/lighting/Recover()
|
||||
|
||||
Reference in New Issue
Block a user