Skip to content

Commit

Permalink
next_attack
Browse files Browse the repository at this point in the history
  • Loading branch information
Xander3359 committed Jun 30, 2024
1 parent 3c2d980 commit f1b9f0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

/**
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1b9f0c

Please sign in to comment.