Replaces a bunch of obj vars (and emagged on machinery/items) with obj_flags (#34078)

* It works, but is it worth it?

* bitfield helpers take 1

* Would this work?

* remove dangling debug code

* rebase & fixes

* vv bitfield stuff, reading

* DNM oceans of shitcode DNM

* honk

* honk2

* plonk

* rebase & fix
This commit is contained in:
vuonojenmustaturska
2018-01-22 20:19:46 +01:00
committed by AnturK
parent 70bec96f9c
commit 6406896df1
110 changed files with 624 additions and 447 deletions
+2 -2
View File
@@ -66,9 +66,9 @@
to_chat(usr, "<span class='notice'>Unable to comply.</span>")
/obj/machinery/computer/shuttle/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
return
req_access = list()
emagged = TRUE
obj_flags |= EMAGGED
to_chat(user, "<span class='notice'>You fried the consoles ID checking system.</span>")
+10 -10
View File
@@ -36,14 +36,14 @@
var/name = ID.registered_name
var/job = ID.assignment
if(emagged)
if(obj_flags & EMAGGED)
name = Gibberish(name, 0)
job = Gibberish(job, 0)
A += list(list("name" = name, "job" = job))
data["authorizations"] = A
data["enabled"] = (IS_DOCKED && !ENGINES_STARTED)
data["emagged"] = emagged
data["emagged"] = obj_flags & EMAGGED ? 1 : 0
return data
/obj/machinery/computer/emergency_shuttle/ui_act(action, params, datum/tgui/ui)
@@ -119,16 +119,16 @@
if(SSshuttle.emergency.mode == SHUTTLE_STRANDED)
authorized.Cut()
emagged = FALSE
obj_flags &= ~EMAGGED
if(ENGINES_STARTED || (!IS_DOCKED))
return .
// Check to see if we've reached criteria for early launch
if((authorized.len >= auth_need) || emagged)
if((authorized.len >= auth_need) || (obj_flags & EMAGGED))
// shuttle timers use 1/10th seconds internally
SSshuttle.emergency.setTimer(ENGINES_START_TIME)
var/system_error = emagged ? "SYSTEM ERROR:" : null
var/system_error = obj_flags & EMAGGED ? "SYSTEM ERROR:" : null
minor_announce("The emergency shuttle will launch in \
[TIME_LEFT] seconds", system_error, alert=TRUE)
. = TRUE
@@ -138,7 +138,7 @@
if(!IS_DOCKED)
return
if(emagged || ENGINES_STARTED) //SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LAUNCH IN 10 SECONDS
if((obj_flags & EMAGGED) || ENGINES_STARTED) //SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LAUNCH IN 10 SECONDS
to_chat(user, "<span class='warning'>The shuttle is already about to launch!</span>")
return
@@ -149,7 +149,7 @@
has emagged the emergency shuttle [time] seconds before launch.", 0, 1)
log_game("[key_name(user)] has emagged the emergency shuttle in \
[COORD(src)] [time] seconds before launch.")
emagged = TRUE
obj_flags |= EMAGGED
var/datum/species/S = new
for(var/i in 1 to 10)
// the shuttle system doesn't know who these people are, but they
@@ -415,7 +415,7 @@
/obj/docking_port/mobile/pod/request()
var/obj/machinery/computer/shuttle/S = getControlConsole()
if(GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA || (S && S.emagged))
if(GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA || (S && (S.obj_flags & EMAGGED)))
if(launch_status == UNLAUNCHED)
launch_status = EARLY_LAUNCHED
return ..()
@@ -446,9 +446,9 @@
return
/obj/machinery/computer/shuttle/pod/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
return
emagged = TRUE
obj_flags |= EMAGGED
to_chat(user, "<span class='warning'>You fry the pod's alert level checking system.</span>")
/obj/docking_port/stationary/random