Fixed respawn/health problems after shotgun death.

This commit is contained in:
Felix Ableitner 2013-08-25 22:49:52 +02:00
parent 21fa8ce0c5
commit b45dd01c72
2 changed files with 5 additions and 1 deletions

View file

@ -58,8 +58,11 @@ Character::onDamage(int damage) {
mCurrentHealth = mMaxHealth;
if (mCurrentHealth <= 0) {
// Seperated to avoid firing multiple times (when damaged multiple times).
if (!mIsDead)
onDeath();
mIsDead = true;
mCurrentHealth = 0;
onDeath();
setDelete(true);
}
}

View file

@ -93,6 +93,7 @@ private:
std::vector<Vector2f> mPath; //< Contains nodes to reach a set destination.
Vector2f mLastPosition;
Faction mFaction;
bool mIsDead = false;
};
#endif /* DG_ACTOR_H_ */