mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 13:05:44 +01:00
Fixes #5648
Now scanner will just give warning if clicked too fast, instead of giving obsolete data. Also moved code from New() to initalize(), since it depends on all things already being there and a master controller existing.
This commit is contained in:
@@ -13,22 +13,23 @@
|
||||
var/last_scan_time = 0
|
||||
var/scan_delay = 25
|
||||
|
||||
/obj/item/device/ano_scanner/New()
|
||||
..()
|
||||
spawn(0)
|
||||
scan()
|
||||
/obj/item/device/ano_scanner/initialize()
|
||||
scan()
|
||||
|
||||
/obj/item/device/ano_scanner/attack_self(var/mob/user as mob)
|
||||
return src.interact(user)
|
||||
|
||||
/obj/item/device/ano_scanner/interact(var/mob/user as mob)
|
||||
var/message = "Background radiation levels detected."
|
||||
if(nearest_artifact_distance >= 0)
|
||||
message = "Exotic energy detected on wavelength '[nearest_artifact_id]' in a radius of [nearest_artifact_distance]m"
|
||||
user << "<span class='info'>[message]</span>"
|
||||
if(world.time - last_scan_time >= scan_delay)
|
||||
spawn(0)
|
||||
scan()
|
||||
if(nearest_artifact_distance >= 0)
|
||||
message = "Exotic energy detected on wavelength '[nearest_artifact_id]' in a radius of [nearest_artifact_distance]m"
|
||||
else
|
||||
message = "Scanning array is recharging."
|
||||
|
||||
user << "<span class='info'>[message]</span>"
|
||||
|
||||
/obj/item/device/ano_scanner/proc/scan()
|
||||
set background = 1
|
||||
|
||||
Reference in New Issue
Block a user