GameObject::~GameObject() { onDied( *this ); wrld.player( m.pl ).delUnit(this); if( !getClass().data.isBackground && !m.isEnv ) wrld.onObjectDelete( this ); }
void Entity::doDamage(int damage) { health -= damage; if(health <= 0) { onDied(); } }