]> git.localhorst.tv Git - blobs.git/commitdiff
fix age of dead people
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 8 Dec 2017 23:02:07 +0000 (00:02 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 8 Dec 2017 23:02:07 +0000 (00:02 +0100)
src/creature/creature.cpp

index eebd4f6f51313ba0e6a9fd7ac4155be1513f4914..6f619b940b7aea79d87aaea0fce921157bd3eaca 100644 (file)
@@ -266,7 +266,7 @@ void Creature::AddParent(Creature &p) {
 }
 
 double Creature::Age() const noexcept {
-       return sim.Time() - birth;
+       return Dead() ? death - birth : sim.Time() - birth;
 }
 
 double Creature::AgeFactor(double peak) const noexcept {