Wait about 2s before despawning killed mobs.

This gives them enough time to play their death animations before
they disappear.
This commit is contained in:
2020-09-22 00:21:43 +02:00
parent a768a4f539
commit 12fbdc9621
3 changed files with 21 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ struct Mob : public BaseNPC {
const int maxHealth;
time_t killedTime = 0;
const int regenTime;
bool despawned = false; // for the sake of death animations
Mob(int x, int y, int z, int type, int hp, int angle, int rt)
: BaseNPC(x, y, z, type), maxHealth(hp), regenTime(rt) {