mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-17 02:47:58 +01:00
Lag War 2: Revengeance (#21950)
<img width="750" height="449" alt="image" src="https://github.com/user-attachments/assets/29c06609-eb62-42be-9b9c-334f9fe88636" /> Ports: tgstation/tgstation#75769, tgstation/tgstation#72572, tgstation/tgstation#93054 Fixes the holodeck causing 800 trillion hard dels that brings the server to its knees. Stops turrets, weather system, and overmap contacts from generating 500+ timers every tick by just using vars instead. --------- Signed-off-by: Wildkins <john.wildkins@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
var/name = "Unknown" // Contact name.
|
||||
var/image/marker // Image overlay attached to the contact.
|
||||
var/pinged = FALSE // Used to animate overmap effects.
|
||||
var/pinged_until = 0 // Used to animate overmap effects.
|
||||
var/list/images = list() // Our list of images to cast to users.
|
||||
var/image/radar // Radar image for sonar esque effect
|
||||
|
||||
@@ -70,18 +70,15 @@
|
||||
M.client.images |= images
|
||||
|
||||
|
||||
/datum/overmap_contact/proc/ping()
|
||||
if(pinged)
|
||||
/datum/overmap_contact/proc/ping(time_delay = 0)
|
||||
if(pinged_until > world.time)
|
||||
return
|
||||
pinged = TRUE
|
||||
pinged_until = world.time + time_delay + 1 SECOND
|
||||
effect.opacity = initial(effect.opacity)
|
||||
show()
|
||||
animate(marker, alpha=255, 0.5 SECOND, 1, LINEAR_EASING)
|
||||
addtimer(CALLBACK(src, PROC_REF(unping)), 1 SECOND)
|
||||
|
||||
/datum/overmap_contact/proc/unping()
|
||||
animate(marker, alpha=75, 2 SECOND, 1, LINEAR_EASING)
|
||||
pinged = FALSE
|
||||
animate(marker, alpha=75, time_delay, 1, flags = ANIMATION_END_NOW)
|
||||
animate(alpha=255, 1 SECOND, 1)
|
||||
animate(alpha=75, 2 SECOND, 1)
|
||||
|
||||
/datum/overmap_contact/Destroy()
|
||||
if(owner)
|
||||
|
||||
@@ -139,10 +139,9 @@
|
||||
continue
|
||||
// Update identification information for this record.
|
||||
record.update_marker_icon()
|
||||
|
||||
var/time_delay = max((SENSOR_TIME_DELAY * get_dist(linked, contact)),1)
|
||||
if(!record.pinged)
|
||||
addtimer(CALLBACK(record, PROC_REF(ping)), time_delay)
|
||||
if(record.pinged_until <= world.time)
|
||||
var/time_delay = max((SENSOR_TIME_DELAY * get_dist(linked, contact)), 1 SECOND)
|
||||
record.ping(time_delay)
|
||||
|
||||
/**
|
||||
* Adds an overmap object to the known contacts.
|
||||
|
||||
Reference in New Issue
Block a user