mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-19 11:08:35 +01:00
GPSes now show the general direction of crosslinked z-levels (#87437)
## About The Pull Request This makes the GPS UI give the general direction of a GPS on a different linked z-level. https://github.com/user-attachments/assets/98c6dfd8-5ced-4145-b14a-3813821ef30c ## Why It's Good For The Game Makes navigating through space less of a chore, as previously, I believe the only way was to manually write down or memorize what direction was linked to what z-level. ## Changelog 🆑 add: GPSes now show the general direction of cross-linked z-levels. /🆑
This commit is contained in:
@@ -137,19 +137,23 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/datum/component/gps/G = gps
|
||||
if(G.emped || !G.tracking || G == src)
|
||||
for(var/datum/component/gps/gps as anything in GLOB.GPS_list)
|
||||
if(gps == src || gps.emped || !gps.tracking)
|
||||
continue
|
||||
var/turf/pos = get_turf(G.parent)
|
||||
if(!pos || !global_mode && pos.z != curr.z)
|
||||
var/turf/pos = get_turf(gps.parent)
|
||||
if(!pos || (!global_mode && pos.z != curr.z))
|
||||
continue
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["entrytag"] = gps.gpstag //Name or 'tag' of the GPS
|
||||
signal["coords"] = "[pos.x], [pos.y], [pos.z]"
|
||||
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
|
||||
// Distance is calculated for the same z-level only, and direction is calculated for crosslinked/neighboring and same z-levels.
|
||||
if(pos.z == curr.z)
|
||||
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
|
||||
signal["degrees"] = round(get_angle(curr, pos)) //0-360 degree directional bearing, for more precision.
|
||||
else
|
||||
var/angle = get_linked_z_angle(curr.z, pos.z)
|
||||
if(!isnull(angle))
|
||||
signal["degrees"] = angle
|
||||
signals += list(signal) //Add this signal to the list of signals
|
||||
data["signals"] = signals
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user