mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-22 21:37:10 +01:00
This reverts commit e67e9b43f5.
This commit is contained in:
@@ -985,10 +985,11 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
var/v
|
||||
var/static/list/exclude = list("usr", "src", "marked", "global")
|
||||
var/long = start < expression.len
|
||||
var/datum/D = is_object_datatype(object) && object
|
||||
var/var_access = expression[start + 1] == "."
|
||||
|
||||
if (object == world && (!long || var_access) && !(expression[start] in exclude)) //3 == length("SS") + 1
|
||||
var/datum/D
|
||||
if(is_object_datatype(object))
|
||||
D = object
|
||||
|
||||
if (object == world && (!long || expression[start + 1] == ".") && !(expression[start] in exclude)) //3 == length("SS") + 1
|
||||
to_chat(usr, "<span class='danger'>World variables are not allowed to be accessed. Use global.</span>")
|
||||
return null
|
||||
|
||||
@@ -1002,14 +1003,14 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
return null
|
||||
start++
|
||||
long = start < expression.len
|
||||
else if(D && (!long || var_access) && (expression[start] in D.vars))
|
||||
else if(D != null && (!long || expression[start + 1] == ".") && (expression[start] in D.vars))
|
||||
if(D.can_vv_get(expression[start]) || superuser)
|
||||
v = D.vars[expression[start]]
|
||||
else
|
||||
v = "SECRET"
|
||||
else if(D && long && expression[start + 1] == ":" && hascall(D, expression[start]))
|
||||
else if(D != null && long && expression[start + 1] == ":" && hascall(D, expression[start]))
|
||||
v = expression[start]
|
||||
else if(!long || var_access)
|
||||
else if(!long || expression[start + 1] == ".")
|
||||
switch(expression[start])
|
||||
if("usr")
|
||||
v = usr
|
||||
@@ -1030,24 +1031,58 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
v = Failsafe
|
||||
if("CFG")
|
||||
v = config
|
||||
/*
|
||||
//Subsystem switches
|
||||
if("SSgarbage")
|
||||
v = SSgarbage
|
||||
if("SSmachines")
|
||||
v = SSmachines
|
||||
if("SSobj")
|
||||
v = SSobj
|
||||
if("SSresearch")
|
||||
v = SSresearch
|
||||
if("SSprojectiles")
|
||||
v = SSprojectiles
|
||||
if("SSfastprocess")
|
||||
v = SSfastprocess
|
||||
if("SSticker")
|
||||
v = SSticker
|
||||
if("SStimer")
|
||||
v = SStimer
|
||||
if("SSradiation")
|
||||
v = SSradiation
|
||||
if("SSnpcpool")
|
||||
v = SSnpcpool
|
||||
if("SSmobs")
|
||||
v = SSmobs
|
||||
if("SSquirks")
|
||||
v = SSquirks
|
||||
if("SSwet_floors")
|
||||
v = SSwet_floors
|
||||
if("SSshuttle")
|
||||
v = SSshuttle
|
||||
if("SSmapping")
|
||||
v = SSmapping
|
||||
if("SSevents")
|
||||
v = SSevents
|
||||
//End
|
||||
*/
|
||||
else
|
||||
return null
|
||||
else if(object == GLOB) // Shitty ass hack kill me.
|
||||
v = expression[start]
|
||||
if(long)
|
||||
switch(expression[start + 1])
|
||||
if(".")
|
||||
return SDQL_var(v, expression[start + 2], null, source, superuser, query)
|
||||
if(":")
|
||||
return (query.options & SDQL2_OPTION_BLOCKING_CALLS)? query.SDQL_function_async(object, v, expression[start + 2], source) : query.SDQL_function_blocking(object, v, expression[start + 2], source)
|
||||
if("\[")
|
||||
if(islist(v))
|
||||
var/list/L = v
|
||||
var/index = query.SDQL_expression(source, expression[start + 2])
|
||||
if(isnum(index) && (!ISINTEGER(index) || L.len < index))
|
||||
to_chat(usr, "<span class='danger'>Invalid list index: [index]</span>")
|
||||
return null
|
||||
return L[index]
|
||||
if(expression[start + 1] == ".")
|
||||
return SDQL_var(v, expression[start + 2], null, source, superuser, query)
|
||||
else if(expression[start + 1] == ":")
|
||||
return (query.options & SDQL2_OPTION_BLOCKING_CALLS)? query.SDQL_function_async(object, v, expression[start + 2], source) : query.SDQL_function_blocking(object, v, expression[start + 2], source)
|
||||
else if(expression[start + 1] == "\[" && islist(v))
|
||||
var/list/L = v
|
||||
var/index = query.SDQL_expression(source, expression[start + 2])
|
||||
if(isnum(index) && (!ISINTEGER(index) || L.len < index))
|
||||
to_chat(usr, "<span class='danger'>Invalid list index: [index]</span>")
|
||||
return null
|
||||
return L[index]
|
||||
return v
|
||||
|
||||
/proc/SDQL2_tokenize(query_text)
|
||||
|
||||
Reference in New Issue
Block a user