From f1b9f0c981c382aa231f4fe351435fc6bc14720c Mon Sep 17 00:00:00 2001 From: Xander3359 <66163761+Xander3359@users.noreply.github.com> Date: Sun, 30 Jun 2024 10:22:09 -0400 Subject: [PATCH] next_attack --- code/_onclick/item_attack.dm | 4 ++-- code/modules/mob/mob_defines.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 2442d401e752a..05586df3f4934 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -56,7 +56,7 @@ /atom/proc/attackby(obj/item/attacking_item, mob/user, params) SIGNAL_HANDLER_DOES_SLEEP - if(user.last_attack > world.time) + if(user.next_attack > world.time) return TRUE add_fingerprint(user, "attackby", attacking_item) if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACKBY, attacking_item, user, params) & COMPONENT_NO_AFTERATTACK) @@ -167,7 +167,7 @@ . = ..() if(.) return TRUE - user.last_attack = world.time + I.attack_speed + user.next_attack = world.time + I.attack_speed return I.attack(src, user) /** diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index e04c6ed143eea..a697fbe4e14f3 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -40,7 +40,7 @@ ///integer, stores the time of whenever changeNext_move() gets ran var/next_move = 0 ///integer, stores world.time + attack_speed whenever attack is ran - var/last_attack = 0 + var/next_attack = 0 ///Amount to adjust action/click delays by, + or - var/next_move_adjust = 0 //Value to multiply action/click delays by