Permalink
Browse files

Crash prevention + shitty logging

  • Loading branch information...
1 parent d64ea77 commit 9eed8c58f7992294c5305b85ce01a79f11e7f52f @JamieH JamieH committed Feb 17, 2017
Showing with 18 additions and 14 deletions.
  1. +18 −14 code/modules/telesci/telepad.dm
@@ -65,9 +65,9 @@
var/stage = 0
var/active = FALSE
-/obj/machinery/telepad_cargo/New()
+/obj/machinery/telepad_cargo/Initialize()
..()
- if (name == "cargo telepad")
+ if (if name == initial(src.name))
name += " ([rand(100,999)])"
if (active && cargopads[src] != null)
LAZYADD(cargopads, src)
@@ -112,18 +112,20 @@
return ..()
/obj/machinery/telepad_cargo/attack_hand(mob/living/user)
- if (active == TRUE)
- user << "You switch the receiver off."
- icon_state = "pad-idle-o"
- active = FALSE
- if (cargopads[src] != null)
- LAZYREMOVE(cargopads, src)
- else
- user << "You switch the receiver on."
- icon_state = "pad-idle"
- active = TRUE
- if (cargopads[src] != null)
- LAZYADD(cargopads, src)
+ if(do_after(user, 20*W.toolspeed, target = src, unique=TRUE))
+ message_admins("[key_name_admin(user)] has toggled the power to [name]")
+ if (active == TRUE)
+ user << "You switch the receiver off."
+ icon_state = "pad-idle-o"
+ active = FALSE
+ if (cargopads[src] != null)
+ LAZYREMOVE(cargopads, src)
+ else
+ user << "You switch the receiver on."
+ icon_state = "pad-idle"
+ active = TRUE
+ if (cargopads[src] != null)
+ LAZYADD(cargopads, src)
///TELEPAD CALLER///
/obj/item/device/telepad_beacon
@@ -201,6 +203,8 @@
user << " <span style=\"color:red\">The transporter is out of charge.</span>"
return
+ message_admins("[key_name_admin(user)] is using the Cargo Teleporter - [T]")
+
user << "<span style=\"color:blue\">Teleporting [T]...</span>"
playsound(user.loc, "sound/machines/click.ogg", 50, 1)

0 comments on commit 9eed8c5

Please sign in to comment.