Fixed bug where the wrong flag was being set when taking damage.