Skip to content

Commit

Permalink
[MIRROR] Fix lifeline not respecting suit sensors (#1014)
Browse files Browse the repository at this point in the history
* Fix lifeline not respecting suit sensors (#81517)

## About The Pull Request

- Lifeline app now respect suits sensors again. 
- The proc always `return .`'d if the target mob was not on suit
sensors, so if `.` was `RADAR_TRACKABLE`, well, it would rack sensorless
mobs.
 
- Cleaned up a bit of trackable. 
   - Use the `is_valid_z_level` helper. 
   - Respect all possible returns for a signal. 

## Changelog

:cl: Melbert
fix: Lifeline can no longer track mobs with suit sensors off
/:cl:

* Fix lifeline not respecting suit sensors

---------

Co-authored-by: MrMelbert <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Feb 18, 2024
1 parent 30dfd4c commit 2a2489d
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions code/modules/modular_computers/file_system/programs/radar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,13 @@
return RADAR_NOT_TRACKABLE
var/turf/here = get_turf(computer)
var/turf/there = get_turf(signal)
if(!here || !there)
return RADAR_NOT_TRACKABLE //I was still getting a runtime even after the above check while scanning, so fuck it
if(there.z != here.z && (!is_station_level(here.z) || !is_station_level(there.z)))
if(isnull(here) || isnull(there) || !is_valid_z_level(here, there))
return RADAR_NOT_TRACKABLE
var/trackable_signal = SEND_SIGNAL(computer, COMSIG_MODULAR_COMPUTER_RADAR_TRACKABLE, signal, here, there)
switch(trackable_signal)
if(COMPONENT_RADAR_TRACK_ANYWAY)
return RADAR_TRACKABLE_ANYWAY
if(COMPONENT_RADAR_DONT_TRACK)
return RADAR_NOT_TRACKABLE
if(trackable_signal & COMPONENT_RADAR_TRACK_ANYWAY)
return RADAR_TRACKABLE_ANYWAY
if(trackable_signal & COMPONENT_RADAR_DONT_TRACK)
return RADAR_NOT_TRACKABLE
return RADAR_TRACKABLE

/**
Expand Down Expand Up @@ -268,15 +265,16 @@

/datum/computer_file/program/radar/lifeline/trackable(mob/living/carbon/human/humanoid)
. = ..()
if(. == RADAR_TRACKABLE_ANYWAY)
return RADAR_TRACKABLE_ANYWAY
if(!humanoid || !istype(humanoid))
if(. != RADAR_TRACKABLE)
return .
if(!istype(humanoid))
return RADAR_NOT_TRACKABLE
if(!istype(humanoid.w_uniform, /obj/item/clothing/under))
return RADAR_NOT_TRACKABLE
var/obj/item/clothing/under/uniform = humanoid.w_uniform
if(uniform.has_sensor && uniform.sensor_mode >= SENSOR_COORDS) // Suit sensors must be on maximum
return RADAR_TRACKABLE
if(!uniform.has_sensor || uniform.sensor_mode < SENSOR_COORDS) // Suit sensors must be on maximum
return RADAR_NOT_TRACKABLE
return .

///Tracks all janitor equipment
/datum/computer_file/program/radar/custodial_locator
Expand Down

0 comments on commit 2a2489d

Please sign in to comment.