Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Contrabang authored Feb 16, 2024
1 parent 22728cf commit 6cee397
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions code/game/machinery/teleporter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
var/A = 40
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
A -= M.rating * 10
tele_delay = max(A, 0)
tele_delay = max(A, 1) // prevents you from teleporting 50000 times in a single tick
update_icon(UPDATE_ICON_STATE)

/obj/machinery/teleport/perma/Crossed(atom/movable/AM, oldloc)
Expand All @@ -491,11 +491,10 @@
if(target && !recalibrating && !panel_open && !blockAI(AM))
do_teleport(AM, target)
use_power(5000)
if(tele_delay)
recalibrating = TRUE
update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS)
update_lighting()
addtimer(CALLBACK(src, PROC_REF(CrossedCallback)), tele_delay)
recalibrating = TRUE
update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS)
update_lighting()
addtimer(CALLBACK(src, PROC_REF(CrossedCallback)), max(tele_delay, 1))

/obj/machinery/teleport/perma/proc/CrossedCallback()
recalibrating = FALSE
Expand Down

0 comments on commit 6cee397

Please sign in to comment.