Skip to content

Commit

Permalink
AI tracking is no longer scared of naked people, and other fun storie…
Browse files Browse the repository at this point in the history
…s. (#2650)
  • Loading branch information
DeltaFire15 authored Jun 14, 2024
1 parent f1daca0 commit c2b8db4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/datums/components/holomap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/datum/component/holomap/proc/get_user()
RETURN_TYPE(/mob/living)
var/atom/movable/holder = parent
return (isliving(holder) || !isatom(holder)) ? holder : holder.loc
return (isliving(holder) || !isatom(holder)) ? holder : holder.loc //FIXME - This proc is terrible (and can runtime). Just save the user and track if they get del'd like a sane person. Why is this like this??????

/datum/component/holomap/Initialize()
. = ..()
Expand Down
13 changes: 13 additions & 0 deletions code/game/machinery/camera/tracking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,23 @@
if(!target_name)
return

var/freshlist = FALSE //NSV13 - tracking bugs
if(!track.initialized)
trackable_mobs()
freshlist = TRUE //NSV13 - tracking bugs

//NSV13 - safer checks.
var/datum/weakref/target = (isnull(track.humans[target_name]) ? track.others[target_name] : track.humans[target_name])
if((isnull(target) || !istype(target))) //Uh oh!
if(freshlist) //Already accurate new list
return

trackable_mobs() //Target may be new.
target = (isnull(track.humans[target_name]) ? track.others[target_name] : track.humans[target_name])
if((isnull(target) || !istype(target)))
return
//NSV13 end.

ai_start_tracking(target.resolve())

/mob/living/silicon/ai/proc/ai_start_tracking(mob/living/target) //starts ai tracking
Expand Down
2 changes: 1 addition & 1 deletion nsv13/code/modules/mob/living/silicon/ai/track.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ GLOBAL_DATUM_INIT(tracking_menu, /datum/track_menu, new)
var/mob/living/carbon/human/player = mob_poi
var/nanite_sensors = HAS_TRAIT(player, TRAIT_NANITE_SENSORS)
var/obj/item/clothing/under/uniform = player.w_uniform
if(nanite_sensors || uniform.sensor_mode >= SENSOR_VITALS)
if(nanite_sensors || (uniform && uniform.sensor_mode >= SENSOR_VITALS))
serialized["health"] = FLOOR((player.health / player.maxHealth * 100), 1)

var/obj/item/card/id/identification_card = mob_poi.get_idcard()
Expand Down

0 comments on commit c2b8db4

Please sign in to comment.