I'm trying to make melee combat and am having some trouble keeping the player from moving while he is attacking.

So in this picture the program checks if a mouse button is pressed and if one is then it checks to see if the "swing" attribute is set (Swing attribute is set if the player is already attacking), if it is not then the players x and y coordinates are stored into attributes and the attacking animation begins. After the animation ends it returns to its original animation.

In this picture if the player has collided with a actor and the mouse was pressed after the attack animation is over (SwordAnimeTime is how long the animation takes) the actor that he collided with will be dealt 1 damage.

Lastly in this picture is what isn't working properly, the game checks to see if the player is doing his attack and if he is then it should move him to where he had began the attack. Although it doesn't...
If anyone knows why it doesn't work or knows a better way to implement this system I'd really appreciate the answer, thanks.