From 1625ecdef408e41cbabcc4f7d846f85774d862d6 Mon Sep 17 00:00:00 2001 From: Tlaltecuhtli <33834933+Tlaltecuhtli@users.noreply.github.com> Date: Mon, 27 May 2019 12:53:11 +0200 Subject: [PATCH] fixes message spam from ridden vehicles (#44116) * fixes message spam from ridden vehicles * e --- code/modules/vehicles/ridden.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/vehicles/ridden.dm b/code/modules/vehicles/ridden.dm index f124bc76a0f..c25c0627af7 100644 --- a/code/modules/vehicles/ridden.dm +++ b/code/modules/vehicles/ridden.dm @@ -7,6 +7,7 @@ var/legs_required = 2 var/arms_required = 1 //why not? var/fall_off_if_missing_arms = FALSE //heh... + var/message_cooldown = 0 /obj/vehicle/ridden/Initialize() . = ..() @@ -64,7 +65,9 @@ if(legs_required) var/how_many_legs = user.get_num_legs() if(how_many_legs < legs_required) - to_chat(user, "You can't seem to manage that with[how_many_legs ? " your leg[how_many_legs > 1 ? "s" : null]" : "out legs"]...") + if(message_cooldown < world.time) + to_chat(user, "You can't seem to manage that with[how_many_legs ? " your leg[how_many_legs > 1 ? "s" : null]" : "out legs"]...") + message_cooldown = world.time + 5 SECONDS return FALSE if(arms_required) var/how_many_arms = user.get_num_arms() @@ -78,7 +81,9 @@ L.Stun(30) return FALSE - to_chat(user, "You can't seem to manage that with[how_many_arms ? " your arm[how_many_arms > 1 ? "s" : null]" : "out arms"]...") + if(message_cooldown < world.time) + to_chat(user, "You can't seem to manage that with[how_many_arms ? " your arm[how_many_arms > 1 ? "s" : null]" : "out arms"]...") + message_cooldown = world.time + 5 SECONDS return FALSE var/datum/component/riding/R = GetComponent(/datum/component/riding) R.handle_ride(user, direction)