1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Bonus Source ID now uses metaidentifier

This commit is contained in:
Ivan Savenko
2023-10-10 18:05:18 +03:00
parent 77facf9387
commit b394158dc9
85 changed files with 295 additions and 262 deletions

View File

@@ -988,14 +988,14 @@ void CGSirens::initObj(CRandomGenerator & rand)
std::string CGSirens::getHoverText(const CGHeroInstance * hero) const
{
return getObjectName() + " " + visitedTxt(hero->hasBonusFrom(BonusSource::OBJECT,ID));
return getObjectName() + " " + visitedTxt(hero->hasBonusFrom(BonusSource::OBJECT, TBonusSourceID(ID)));
}
void CGSirens::onHeroVisit( const CGHeroInstance * h ) const
{
InfoWindow iw;
iw.player = h->tempOwner;
if(h->hasBonusFrom(BonusSource::OBJECT,ID)) //has already visited Sirens
if(h->hasBonusFrom(BonusSource::OBJECT, TBonusSourceID(ID))) //has already visited Sirens
{
iw.type = EInfoWindowMode::AUTO;
iw.text.appendLocalString(EMetaText::ADVOB_TXT,133);
@@ -1180,8 +1180,8 @@ void CGLighthouse::onHeroVisit( const CGHeroInstance * h ) const
{
RemoveBonus rb(GiveBonus::ETarget::PLAYER);
rb.whoID = oldOwner.getNum();
rb.source = vstd::to_underlying(BonusSource::OBJECT);
rb.id = id.getNum();
rb.source = BonusSource::OBJECT;
rb.id = TBonusSourceID(id);
cb->sendAndApply(&rb);
}
}
@@ -1204,7 +1204,7 @@ void CGLighthouse::giveBonusTo(const PlayerColor & player, bool onInit) const
gb.id = player.getNum();
gb.bonus.duration = BonusDuration::PERMANENT;
gb.bonus.source = BonusSource::OBJECT;
gb.bonus.sid = id.getNum();
gb.bonus.sid = TBonusSourceID(id);
gb.bonus.subtype = BonusSubtypes::heroMovementSea;
// FIXME: This is really dirty hack