diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 88eff5d9406..a5cb0c2bcc4 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -1023,10 +1023,14 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/sdql2_vv_all, new(null if(lowertext(copytext(expression[start + 1], 1, 3)) != "0x") //3 == length("0x") + 1 to_chat(usr, span_danger("Invalid pointer syntax: [expression[start + 1]]"), confidential = TRUE) return null - v = locate("\[[expression[start + 1]]]") - if(!v) - to_chat(usr, span_danger("Invalid pointer: [expression[start + 1]]"), confidential = TRUE) + var/datum/located = locate("\[[expression[start + 1]]]") + if(!istype(located)) + to_chat(usr, span_danger("Invalid pointer: [expression[start + 1]] - null or not datum"), confidential = TRUE) return null + if(!located.can_vv_mark()) + to_chat(usr, span_danger("Pointer [expression[start+1]] cannot be marked"), confidential = TRUE) + return null + v = located start++ long = start < expression.len else if(expression[start] == "(" && long) diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm b/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm index e9816d89c4c..dd85da2414c 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm @@ -62,7 +62,10 @@ /proc/_locate(X, Y, Z) if (isnull(Y)) // Assuming that it's only a single-argument call. - return locate(X) + // direct ref locate + var/datum/D = locate(X) + // &&'s to last value + return istype(D) && D.can_vv_mark() && D return locate(X, Y, Z)