Fixing some infinite loops in gun update_icon() calls.

This commit is contained in:
Zuhayr
2016-01-22 04:22:49 +10:30
parent 8f3b545b10
commit ab9574ee06
4 changed files with 8 additions and 9 deletions

View File

@@ -94,10 +94,12 @@
var/mob/living/M = loc
if(istype(M))
if((M.l_hand == src && !M.r_hand) || (M.r_hand == src && !M.l_hand))
name = "[initial(name)] (wielded)"
item_state = wielded_icon
else
name = initial(name)
item_state = initial(item_state)
update_icon() // In case item_state is set somewhere else.
update_icon(ignore_inhands=1) // In case item_state is set somewhere else.
..()
//Checks whether a given mob can use the gun
@@ -177,7 +179,6 @@
var/held_acc_mod = 0
var/held_disp_mod = 0
if(requires_two_hands)
update_held_icon()
if((user.l_hand == src && user.r_hand) || (user.r_hand == src && user.l_hand))
held_acc_mod = -3
held_disp_mod = 3
@@ -210,8 +211,6 @@
admin_attack_log(usr, attacker_message="Fired [src]", admin_message="fired a gun ([src]) (MODE: [src.mode_name]) [reflex ? "by reflex" : "manually"].")
update_held_icon()
//update timing
user.setClickCooldown(4)
user.setMoveCooldown(move_delay)