Merge pull request #9900 from VOREStation/upstream-merge-7958

[MIRROR] Fixes context-menu examine expanding incorrect target
This commit is contained in:
Novacat
2021-03-10 14:46:32 -05:00
committed by Chompstation Bot
parent 9e2af79bc3
commit 6af8ca393b
5 changed files with 22 additions and 28 deletions

View File

@@ -10,3 +10,7 @@
viewX = text2num(viewrangelist[1]) viewX = text2num(viewrangelist[1])
viewY = text2num(viewrangelist[2]) viewY = text2num(viewrangelist[2])
return list(viewX, viewY) return list(viewX, viewY)
// Used to get `atom/O as obj|mob|turf in view()` to match against strings containing apostrophes immediately after substrings that match to other objects. Somehow. - Ater
/proc/_validate_atom(atom/A)
return view()

View File

@@ -76,9 +76,4 @@
onclose(usr, "admin_dialogue_log") onclose(usr, "admin_dialogue_log")
feedback_add_details("admin_verb","PDL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! feedback_add_details("admin_verb","PDL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// Used to get `atom/O as obj|mob|turf in view()` to match against strings containing apostrophes immediately after substrings that match to other objects. Somehow. - Ater
/proc/admin_atom_validate(atom/A)
return view()

View File

@@ -629,7 +629,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("[key_name_admin(src)] has created a command report", 1) message_admins("[key_name_admin(src)] has created a command report", 1)
feedback_add_details("admin_verb","CCR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! feedback_add_details("admin_verb","CCR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_delete(atom/O as obj|mob|turf in admin_atom_validate(O)) // I don't understand precisely how this fixes the string matching against a substring, but it does - Ater /client/proc/cmd_admin_delete(atom/O as obj|mob|turf in _validate_atom(O)) // I don't understand precisely how this fixes the string matching against a substring, but it does - Ater
set category = "Admin" set category = "Admin"
set name = "Delete" set name = "Delete"

View File

@@ -76,10 +76,24 @@
stat(null,"<font color='#8A0808'><b>[description_holders["antag"]]</b></font>") //Red, malicious antag-related text stat(null,"<font color='#8A0808'><b>[description_holders["antag"]]</b></font>") //Red, malicious antag-related text
//override examinate verb to update description holders when things are examined //override examinate verb to update description holders when things are examined
/mob/examinate(atom/A as mob|obj|turf in view()) //mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine()
if(..()) /mob/verb/examinate(atom/A as mob|obj|turf in _validate_atom(A))
set name = "Examine"
set category = "IC"
if((is_blind(src) || usr.stat) && !isobserver(src))
to_chat(src, "<span class='notice'>Something is there but you can't see it.</span>")
return 1 return 1
//Could be gone by the time they finally pick something
if(!A)
return 1
face_atom(A)
var/list/results = A.examine(src)
if(!results || !results.len)
results = list("You were unable to examine that. Tell a developer!")
to_chat(src, jointext(results, "<br>"))
update_examine_panel(A) update_examine_panel(A)
/mob/proc/update_examine_panel(var/atom/A) /mob/proc/update_examine_panel(var/atom/A)

View File

@@ -194,25 +194,6 @@
client.eye = loc client.eye = loc
return TRUE return TRUE
//mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine()
/mob/verb/examinate(atom/A as mob|obj|turf in view())
set name = "Examine"
set category = "IC"
if((is_blind(src) || usr.stat) && !isobserver(src))
to_chat(src, "<span class='notice'>Something is there but you can't see it.</span>")
return 1
//Could be gone by the time they finally pick something
if(!A)
return 1
face_atom(A)
var/list/results = A.examine(src)
if(!results || !results.len)
results = list("You were unable to examine that. Tell a developer!")
to_chat(src, jointext(results, "<br>"))
/mob/verb/pointed(atom/A as mob|obj|turf in view()) /mob/verb/pointed(atom/A as mob|obj|turf in view())
set name = "Point To" set name = "Point To"
set category = "Object" set category = "Object"