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

Pass pointer to actual caller in showBlockingDialog callWith

Fixes activation of all rewardable buildings in town on blocking dialog
answer
This commit is contained in:
Ivan Savenko
2024-09-04 15:14:56 +00:00
parent d34b4a141e
commit b09d9d501b
17 changed files with 28 additions and 31 deletions

View File

@@ -164,7 +164,7 @@ void CGCreature::onHeroVisit( const CGHeroInstance * h ) const
ynd.player = h->tempOwner;
ynd.text.appendLocalString(EMetaText::ADVOB_TXT, 86);
ynd.text.replaceName(getCreature(), getStackCount(SlotID(0)));
cb->showBlockingDialog(&ynd);
cb->showBlockingDialog(this, &ynd);
break;
}
default: //join for gold
@@ -180,7 +180,7 @@ void CGCreature::onHeroVisit( const CGHeroInstance * h ) const
boost::algorithm::replace_first(tmp, "%d", std::to_string(action));
boost::algorithm::replace_first(tmp,"%s",VLC->creatures()->getById(getCreature())->getNamePluralTranslated());
ynd.text.appendRawString(tmp);
cb->showBlockingDialog(&ynd);
cb->showBlockingDialog(this, &ynd);
break;
}
}
@@ -475,7 +475,7 @@ void CGCreature::flee( const CGHeroInstance * h ) const
ynd.player = h->tempOwner;
ynd.text.appendLocalString(EMetaText::ADVOB_TXT,91);
ynd.text.replaceName(getCreature(), getStackCount(SlotID(0)));
cb->showBlockingDialog(&ynd);
cb->showBlockingDialog(this, &ynd);
}
void CGCreature::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const