Turn /datum.isprocessing into a datum flag (#38193)
This commit is contained in:
committed by
letterjay
parent
3489ed23c6
commit
83ac5852dd
@@ -19,8 +19,8 @@
|
||||
|
||||
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
|
||||
|
||||
#define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) {Datum.isprocessing = TRUE;Processor.processing += Datum}
|
||||
#define STOP_PROCESSING(Processor, Datum) Datum.isprocessing = FALSE;Processor.processing -= Datum
|
||||
#define START_PROCESSING(Processor, Datum) if (!(Datum.datum_flags & DF_ISPROCESSING)) {Datum.datum_flags |= DF_ISPROCESSING;Processor.processing += Datum}
|
||||
#define STOP_PROCESSING(Processor, Datum) Datum.datum_flags &= ~DF_ISPROCESSING;Processor.processing -= Datum
|
||||
|
||||
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
// for /datum/var/datum_flags
|
||||
#define DF_USE_TAG (1<<0)
|
||||
#define DF_VAR_EDITED (1<<1)
|
||||
#define DF_ISPROCESSING (1<<2)
|
||||
|
||||
//FLAGS BITMASK
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ GLOBAL_LIST_INIT(bitfields, list(
|
||||
),
|
||||
"datum_flags" = list(
|
||||
"DF_USE_TAG" = DF_USE_TAG,
|
||||
"DF_VAR_EDITED" = DF_VAR_EDITED
|
||||
"DF_VAR_EDITED" = DF_VAR_EDITED,
|
||||
"DF_ISPROCESSING" = DF_ISPROCESSING,
|
||||
),
|
||||
"item_flags" = list(
|
||||
"BEING_REMOVED" = BEING_REMOVED,
|
||||
|
||||
@@ -45,7 +45,7 @@ SUBSYSTEM_DEF(machines)
|
||||
else
|
||||
processing -= thing
|
||||
if (!QDELETED(thing))
|
||||
thing.isprocessing = FALSE
|
||||
thing.datum_flags &= ~DF_ISPROCESSING
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ SUBSYSTEM_DEF(processing)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/var/isprocessing = FALSE
|
||||
/datum/proc/process()
|
||||
set waitfor = 0
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
@@ -385,7 +385,7 @@
|
||||
turns = 0
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
if(!isprocessing)
|
||||
if(!(datum_flags & DF_ISPROCESSING))
|
||||
user.visible_message("<span class='notice'>[user] spins [src] around, and Ratvarian technology keeps it spinning FOREVER.</span>", \
|
||||
"<span class='notice'>Automated spinny chairs. The pinnacle of Ratvarian technology.</span>")
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
return
|
||||
if(!is_servant_of_ratvar(user))
|
||||
return
|
||||
if(!isprocessing)
|
||||
if(!(datum_flags & DF_ISPROCESSING))
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
to_chat(user, "<span class='notice'>You activate [src].</span>")
|
||||
icon_state = "[icon_state]_on"
|
||||
|
||||
@@ -356,7 +356,7 @@
|
||||
fired = TRUE
|
||||
if(hitscan)
|
||||
process_hitscan()
|
||||
if(!isprocessing)
|
||||
if(!(datum_flags & DF_ISPROCESSING))
|
||||
START_PROCESSING(SSprojectiles, src)
|
||||
pixel_move(1) //move it now!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user