fix logic
This commit is contained in:
@@ -539,7 +539,8 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
|
||||
#define CANT_REENTER_ROUND -1
|
||||
|
||||
//Nightshift levels.
|
||||
#define NIGHTSHIFT_AREA_NONE 0 //default
|
||||
#define NIGHTSHIFT_AREA_FORCED 0 //ALWAYS nightshift if nightshift is enabled
|
||||
#define NIGHTSHIFT_AREA_PUBLIC 1 //hallways
|
||||
#define NIGHTSHIFT_AREA_RECREATION 2 //dorms common areas, etc
|
||||
#define NIGHTSHIFT_AREA_DEPARTMENT_HALLS 3 //interior hallways, etc
|
||||
#define NIGHTSHIFT_AREA_NONE 4 //default/highest.
|
||||
|
||||
@@ -56,6 +56,8 @@ SUBSYSTEM_DEF(nightshift)
|
||||
max_level = max_level_override
|
||||
for(var/A in GLOB.apcs_list)
|
||||
var/obj/machinery/power/apc/APC = A
|
||||
if(APC.area && (!max_level || !APC.area.nightshift_public_area || (APC.area.nightshift_public_area <= max_level)) && (APC.area.type in GLOB.the_station_areas))
|
||||
APC.set_nightshift(active)
|
||||
CHECK_TICK
|
||||
if(APC.area?.type in GLOB.the_station_areas)
|
||||
var/their_level = APC.area.nightshift_public_area
|
||||
if(!max_level || (their_level <= max_level)) //if max level is 0, it means public area-only config is disabled so hit everything. if their level is 0, it means they have nightshift forced.
|
||||
APC.set_nightshift(active)
|
||||
CHECK_TICK
|
||||
|
||||
Reference in New Issue
Block a user