[s] Fixes IED timer exploit (#47774)

This commit is contained in:
ShizCalev
2019-11-15 00:24:52 -08:00
committed by Rob Bailey
parent d25456365a
commit 6c3eef2b64
2 changed files with 10 additions and 6 deletions
@@ -55,6 +55,9 @@
explosion(src.loc,-1,-1,2, flame_range = 4) // small explosion, plus a very large fireball.
qdel(src)
/obj/item/grenade/iedcasing/change_det_time()
return //always be random.
/obj/item/grenade/iedcasing/examine(mob/user)
. = ..()
. += "You can't tell when it will explode!"
+7 -6
View File
@@ -87,18 +87,19 @@
if(W.tool_behaviour == TOOL_MULTITOOL)
var/newtime = text2num(stripped_input(user, "Please enter a new detonation time", name))
if (newtime != null && user.canUseTopic(src, BE_CLOSE))
change_det_time(newtime)
to_chat(user, "<span class='notice'>You modify the time delay. It's set for [DisplayTimeText(det_time)].</span>")
if (round(newtime * 10) != det_time)
to_chat(user, "<span class='warning'>The new value is out of bounds. The lowest possible time is 3 seconds and highest is 5 seconds. Instant detonations are also possible.</span>")
if(change_det_time(newtime))
to_chat(user, "<span class='notice'>You modify the time delay. It's set for [DisplayTimeText(det_time)].</span>")
if (round(newtime * 10) != det_time)
to_chat(user, "<span class='warning'>The new value is out of bounds. The lowest possible time is 3 seconds and highest is 5 seconds. Instant detonations are also possible.</span>")
return
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
change_det_time()
to_chat(user, "<span class='notice'>You modify the time delay. It's set for [DisplayTimeText(det_time)].</span>")
if(change_det_time())
to_chat(user, "<span class='notice'>You modify the time delay. It's set for [DisplayTimeText(det_time)].</span>")
else
return ..()
/obj/item/grenade/proc/change_det_time(time) //Time uses real time.
. = TRUE
if(time != null)
if(time < 3)
time = 3