1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-19 00:17:56 +02:00

Remove flaggable bonus on object deletion

This commit is contained in:
Dydzio
2024-12-05 21:55:32 +01:00
parent 7be31c94f2
commit 16d25e903c
3 changed files with 18 additions and 3 deletions

View File

@ -51,6 +51,12 @@ void FlaggableMapObject::onHeroVisit( const CGHeroInstance * h ) const
giveBonusTo(h->getOwner());
}
void FlaggableMapObject::markAsDeleted() const
{
if(getOwner().isValidPlayer())
takeBonusFrom(getOwner());
}
void FlaggableMapObject::initObj(vstd::RNG & rand)
{
if(getOwner().isValidPlayer())