mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +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:
@@ -120,11 +120,12 @@ bool CGarrisonDialogQuery::blocksPack(const CPack * pack) const
|
||||
void CBlockingDialogQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||
{
|
||||
assert(answer);
|
||||
visitedObject->blockingDialogAnswered(visitingHero, *answer);
|
||||
caller->blockingDialogAnswered(visitingHero, *answer);
|
||||
}
|
||||
|
||||
CBlockingDialogQuery::CBlockingDialogQuery(CGameHandler * owner, const BlockingDialog & bd):
|
||||
CDialogQuery(owner)
|
||||
CBlockingDialogQuery::CBlockingDialogQuery(CGameHandler * owner, const IObjectInterface * caller, const BlockingDialog & bd):
|
||||
CDialogQuery(owner),
|
||||
caller(caller)
|
||||
{
|
||||
this->bd = bd;
|
||||
addPlayer(bd.player);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
class CGHeroInstance;
|
||||
class CGObjectInstance;
|
||||
class IObjectInterface;
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
//Created when player starts turn or when player puts game on [ause
|
||||
@@ -60,9 +61,10 @@ public:
|
||||
class CBlockingDialogQuery : public CDialogQuery
|
||||
{
|
||||
public:
|
||||
const IObjectInterface * caller;
|
||||
BlockingDialog bd; //copy of pack... debug purposes
|
||||
|
||||
CBlockingDialogQuery(CGameHandler * owner, const BlockingDialog &bd);
|
||||
CBlockingDialogQuery(CGameHandler * owner, const IObjectInterface * caller, const BlockingDialog &bd);
|
||||
|
||||
void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user