Fix glitch when unit dies while attacking and next() is never called, freezing the game.