do_after() checks both turf and loc

This commit is contained in:
Mike
2014-05-16 13:13:02 -04:00
parent 8d1928c117
commit 824f9ceea8

View File

@@ -728,13 +728,14 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
var/delayfraction = round(delay/numticks)
var/original_loc = user.loc
var/original_turf = get_turf(user)
var/holding = user.get_active_hand()
for(var/i = 0, i<numticks, i++)
sleep(delayfraction)
if(!user || user.stat || user.weakened || user.stunned || (user.loc != original_loc))
if(!user || user.stat || user.weakened || user.stunned || user.loc != original_loc || get_turf(user) != original_turf)
return 0
if(needhand && !(user.get_active_hand() == holding)) //Sometimes you don't want the user to have to keep their active hand
return 0