Skip to content
Snippets Groups Projects
Commit 1c6df614 authored by Claudio Hoffmann's avatar Claudio Hoffmann
Browse files

Entity: Don't takeDamage on 0 hit points

parent 5fb2c135
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,10 @@ bool Entity::step(Position const &PlayerPos, FloatSeconds const & Frametime, Lev
int Entity::takeDamage(Color color)
{
hitpoints = std::max((hitpoints - 1), 0);
if(hitpoints == 0) {
return hitpoints;
}
hitpoints--;
hittime = HIT_TIME;
hitcolor = color;
return hitpoints;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment