fixes message spam from ridden vehicles (#44116)

* fixes message spam from ridden vehicles

* e
This commit is contained in:
Tlaltecuhtli
2019-05-27 22:53:11 +12:00
committed by oranges
parent 6eba539983
commit 1625ecdef4
+7 -2
View File
@@ -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, "<span class='warning'>You can't seem to manage that with[how_many_legs ? " your leg[how_many_legs > 1 ? "s" : null]" : "out legs"]...</span>")
if(message_cooldown < world.time)
to_chat(user, "<span class='warning'>You can't seem to manage that with[how_many_legs ? " your leg[how_many_legs > 1 ? "s" : null]" : "out legs"]...</span>")
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, "<span class='warning'>You can't seem to manage that with[how_many_arms ? " your arm[how_many_arms > 1 ? "s" : null]" : "out arms"]...</span>")
if(message_cooldown < world.time)
to_chat(user, "<span class='warning'>You can't seem to manage that with[how_many_arms ? " your arm[how_many_arms > 1 ? "s" : null]" : "out arms"]...</span>")
message_cooldown = world.time + 5 SECONDS
return FALSE
var/datum/component/riding/R = GetComponent(/datum/component/riding)
R.handle_ride(user, direction)