Fixes tsci infinite teleport (#19104)

* Fixes tsci infinite teleport

* Update telesci_computer.dm

* use COOLER COOLDOWN
This commit is contained in:
Cameron Lennox
2026-01-28 18:56:00 -08:00
committed by GitHub
parent 716f7650b4
commit a94a0e727c
+13 -8
View File
@@ -20,7 +20,7 @@
var/distance = 5
// Based on the distance used
var/teleport_cooldown = 0
COOLDOWN_DECLARE(teleport_cooldown)
var/teleporting = 0
var/starting_crystals = 0
var/max_crystals = 4
@@ -101,7 +101,7 @@
data["insertedGps"] = inserted_gps
data["rotation"] = rotation
data["currentZ"] = z_co
data["cooldown"] = max(0, min(100, round(teleport_cooldown - world.time) / 10))
data["cooldown"] = max(0, min(100, COOLDOWN_TIMELEFT(src, teleport_cooldown) / 10))
data["crystalCount"] = crystals.len
data["maxCrystals"] = max_crystals
data["maxPossibleDistance"] = FLOOR((max_crystals * powerCoefficient * 6), 1); // max efficiency is 6
@@ -154,9 +154,9 @@
if(last_target && inserted_gps)
// TODO - What was this even supposed to do??
//inserted_gps.locked_location = last_target
temp_msg = "Location saved."
temp_msg = "Function Deprecated. No action taken."
else
temp_msg = "ERROR! No data was stored."
temp_msg = "Function Deprecated. No action taken."
if("send")
sending = 1
@@ -188,6 +188,7 @@
return
/obj/machinery/computer/telescience/proc/telefail()
COOLDOWN_START(src, teleport_cooldown, (2 SECONDS))
switch(rand(99))
if(0 to 80)
sparks()
@@ -232,9 +233,7 @@
/obj/machinery/computer/telescience/proc/doteleport(mob/user)
if(teleport_cooldown > world.time)
return
if(teleporting)
if(!COOLDOWN_FINISHED(src, teleport_cooldown))
return
if(telepad)
@@ -270,7 +269,7 @@
if(telepad.inoperable())
return
teleporting = 0
teleport_cooldown = world.time + (spawn_time * 2)
COOLDOWN_START(src, teleport_cooldown, (spawn_time * 2))
teles_left -= 1
// use a lot of power
@@ -348,6 +347,12 @@
updateDialog()
/obj/machinery/computer/telescience/proc/teleport(mob/user)
if(!COOLDOWN_FINISHED(src, teleport_cooldown))
temp_msg = "ERROR! Teleportation console is cooling down. Please wait."
return
if(teleporting)
temp_msg = "ERROR! Teleportation in progress. Please wait."
return
distance = CLAMP(distance, 0, get_max_allowed_distance())
if(rotation == null || distance == null || z_co == null)
temp_msg = "ERROR! Set a distance, rotation and sector."