AI can no longer track people who changed identity (#27147)

This commit is contained in:
DamianX
2020-07-20 11:20:04 +02:00
committed by GitHub
parent 4bb2e9a020
commit c455e825ca
10 changed files with 18 additions and 75 deletions

View File

@@ -304,10 +304,7 @@ var/list/camera_messages = list()
for(var/mob/living/silicon/ai/O in living_mob_list) for(var/mob/living/silicon/ai/O in living_mob_list)
if(!O.client) if(!O.client)
continue continue
if(U.name == "Unknown") to_chat(O, "<span class='name'><a href='byond://?src=\ref[O];track=[U.name]'>[U.name]</a></span> holds <a href='byond://?src=\ref[src];message_id=[key]'>[W]</a> up to one of your cameras ...")
to_chat(O, "<span class='name'>[U]</span> holds <a href='byond://?src=\ref[src];message_id=[key]'>[W]</a> up to one of your cameras ...")
else
to_chat(O, "<span class='name'><a href='byond://?src=\ref[O];track2=\ref[O];track=\ref[U]'>[U]</a></span> holds <a href='byond://?src=\ref[src];message_id=[key]'>[W]</a> up to one of your cameras ...")
for(var/mob/O in player_list) for(var/mob/O in player_list)
if (istype(O.machine, /obj/machinery/computer/security)) if (istype(O.machine, /obj/machinery/computer/security))

View File

@@ -267,7 +267,6 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
virt.job = speech.job virt.job = speech.job
//virt.languages = AM.languages //virt.languages = AM.languages
virt.source = speech.speaker virt.source = speech.speaker
virt.faketrack = (data == 4) ? 1 : 0
virt.radio = speech.radio virt.radio = speech.radio
if (compression > 0) if (compression > 0)

View File

@@ -142,30 +142,6 @@
A.open_nearest_door(target) A.open_nearest_door(target)
return return
if (href_list["track"])
var/mob/target = locate(href_list["track"])
var/mob/living/silicon/ai/A = locate(href_list["track2"])
if(A && target)
A.ai_actual_track(target)
return
else if (href_list["faketrack"])
var/mob/target = locate(href_list["track"])
var/mob/living/silicon/ai/A = locate(href_list["track2"])
if(A && target)
A:cameraFollow = target
to_chat(A, text("Now tracking [] on camera.", target.name))
if (usr.machine == null)
usr.machine = usr
while (usr:cameraFollow == target)
to_chat(usr, "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb).")
sleep(40)
continue
return
else if("set_freq" in href_list) else if("set_freq" in href_list)
var/new_frequency var/new_frequency
new_frequency = input(usr, "Set a new frequency (1200-1600 kHz).", src, frequency) as null|num new_frequency = input(usr, "Set a new frequency (1200-1600 kHz).", src, frequency) as null|num

View File

@@ -274,13 +274,6 @@ var/global/image/ghostimg = image("icon"='icons/mob/mob.dmi',"icon_state"="ghost
/atom/movable/proc/GetJob() /atom/movable/proc/GetJob()
return return
/**
* Probably used for getting tracking coordinates?
* TODO: verify
*/
/atom/movable/proc/GetTrack()
return
/** /**
* What is speaking for us? Usually src. * What is speaking for us? Usually src.
*/ */
@@ -294,15 +287,12 @@ var/global/image/ghostimg = image("icon"='icons/mob/mob.dmi',"icon_state"="ghost
/atom/movable/virtualspeaker /atom/movable/virtualspeaker
var/job var/job
var/faketrack
var/atom/movable/source var/atom/movable/source
var/obj/item/device/radio/radio var/obj/item/device/radio/radio
/atom/movable/virtualspeaker/GetJob() /atom/movable/virtualspeaker/GetJob()
return job return job
/atom/movable/virtualspeaker/GetTrack()
return faketrack
/atom/movable/virtualspeaker/GetSource() /atom/movable/virtualspeaker/GetSource()
return source return source

View File

@@ -570,7 +570,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/mob/target = locate(href_list["jump"]) var/mob/target = locate(href_list["jump"])
var/mob/A = usr; var/mob/A = usr;
to_chat(A, "Teleporting to [target]...") to_chat(A, "Teleporting to [target]...")
//var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
if(target && target != usr) if(target && target != usr)
var/turf/pos = get_turf(A) var/turf/pos = get_turf(A)
var/turf/T=get_turf(target) var/turf/T=get_turf(target)

View File

@@ -489,27 +489,15 @@ var/list/ai_list = list()
#endif #endif
if(href_list["track"]) if(href_list["track"])
var/mob/target = locate(href_list["track"]) in mob_list var/name_to_track = href_list["track"]
var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list for(var/mob/some_mob in mob_list)
if(A && target) if(some_mob.name != name_to_track)
A.ai_actual_track(target)
return
else if(href_list["faketrack"])
var/mob/target = locate(href_list["track"]) in mob_list
var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
if(A && target)
A.cameraFollow = target
to_chat(A, text("Now tracking [] on camera.", target.name))
if(usr.machine == null)
usr.machine = usr
while (src.cameraFollow == target)
to_chat(usr, "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb).")
sleep(40)
continue continue
if(!can_track_atom(some_mob))
continue
ai_actual_track(some_mob)
return
to_chat(src, "<span class='warning'>Unable to track [name_to_track].</span>")
return return
if(href_list["open"]) if(href_list["open"])
@@ -840,12 +828,12 @@ var/list/ai_list = list()
return return
mentions_on = !mentions_on mentions_on = !mentions_on
if(!mentions_on) if(!mentions_on)
to_chat(src, "AI mentions deactivated.") to_chat(src, "AI mentions deactivated.")
else else
to_chat(src, "AI mentions activated.") to_chat(src, "AI mentions activated.")
/mob/living/silicon/ai/verb/toggle_station_map() /mob/living/silicon/ai/verb/toggle_station_map()
set name = "Toggle Station Holomap" set name = "Toggle Station Holomap"

View File

@@ -17,11 +17,8 @@
virt_speaker = src virt_speaker = src
if(speech.speaker != src && M != src) if(speech.speaker != src && M != src)
if(M) if(M)
var/faketrack = "byond://?src=\ref[virt_speaker];track2=\ref[src];track=\ref[M]" var/track_link = "byond://?src=\ref[src];track=[M.name]"
if(speech.speaker.GetTrack()) return "<a href='byond://?src=\ref[virt_speaker];open2=\ref[src];open=\ref[M]'>\[OPEN\]</a> <a href='[track_link]'>"
faketrack = "byond://?src=\ref[virt_speaker];track2=\ref[src];faketrack=\ref[M]"
return "<a href='byond://?src=\ref[virt_speaker];open2=\ref[src];open=\ref[M]'>\[OPEN\]</a> <a href='[faketrack]'>"
return "" return ""
/mob/living/silicon/ai/render_speaker_track_end(var/datum/speech/speech) /mob/living/silicon/ai/render_speaker_track_end(var/datum/speech/speech)

View File

@@ -25,7 +25,7 @@
for (var/mob/S in player_list) for (var/mob/S in player_list)
if(istype(S , /mob/living/silicon/ai)) if(istype(S , /mob/living/silicon/ai))
var/renderedAI = "<i><span class='binaryradio'>Robotic Talk, <a href='byond://?src=\ref[S];track2=\ref[S];track=\ref[src]'><span class='name'>[name]</span></a> <span class='message'>[message_a]</span></span></i>" var/renderedAI = "<i><span class='binaryradio'>Robotic Talk, <a href='byond://?src=\ref[S];track=[name]'><span class='name'>[name]</span></a> <span class='message'>[message_a]</span></span></i>"
to_chat(S, renderedAI) to_chat(S, renderedAI)
else if(S.binarycheck() || ((S in dead_mob_list) && !istype(S, /mob/new_player))) else if(S.binarycheck() || ((S in dead_mob_list) && !istype(S, /mob/new_player)))
handle_render(S,rendered,src) handle_render(S,rendered,src)

View File

@@ -46,7 +46,7 @@ global procs
mob/languages mob/languages
list of languages list of languages
What language(s) the speaker speaks, and the hearer understands. What language(s) the speaker speaks, and the hearer understands.
If the hearer doesn't understand it will be treated in lang_treat() If the hearer doesn't understand it will be treated in lang_treat()
mob/universal_speak mob/universal_speak
@@ -65,7 +65,7 @@ global procs
Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq) Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq)
This proc handles hearing. What it does varies. For mobs, it treats the message with hearer-specific things This proc handles hearing. What it does varies. For mobs, it treats the message with hearer-specific things
like language and deafness, then outputs it to the hearer. like language and deafness, then outputs it to the hearer.
IMPORTANT NOTE: If radio_freq is not null, the code will assume that the speaker is virtual! (more info on this in the Radios section below) IMPORTANT NOTE: If radio_freq is not null, the code will assume that the speaker is virtual! (more info on this in the Radios section below)
send_speech(message, range, datum/language/speaking) send_speech(message, range, datum/language/speaking)
@@ -166,8 +166,6 @@ If radio_freq is not null, the code will rely on the fact that the speaker is vi
(all of these procs are defined at the atom/movable level and return "" at that level.) (all of these procs are defined at the atom/movable level and return "" at that level.)
GetJob() GetJob()
Returns the job string variable of the virtual speaker. Returns the job string variable of the virtual speaker.
GetTrack()
Returns wether the tracking href should be fake or not.
GetSource() GetSource()
Returns the source of the virtual speaker. Returns the source of the virtual speaker.
GetRadio() GetRadio()
@@ -175,4 +173,4 @@ If radio_freq is not null, the code will rely on the fact that the speaker is vi
This is fairly hacky, but it means that I can advoid using istypes. It's mainly relevant for AI tracking and AI job display. This is fairly hacky, but it means that I can advoid using istypes. It's mainly relevant for AI tracking and AI job display.
That's all, folks!*/ That's all, folks!*/

View File

@@ -323,7 +323,6 @@
var/atom/movable/virtualspeaker/virt = new /atom/movable/virtualspeaker(null) var/atom/movable/virtualspeaker/virt = new /atom/movable/virtualspeaker(null)
virt.name = source virt.name = source
virt.job = job virt.job = job
virt.faketrack = 1
//END SAY REWRITE RELATED CODE. //END SAY REWRITE RELATED CODE.