mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Clear rewardable garrison after player is done picking units
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "../mapObjects/CGHeroInstance.h"
|
||||
#include "../networkPacks/PacksForClient.h"
|
||||
#include "../networkPacks/PacksForClientBattle.h"
|
||||
#include "../networkPacks/StackLocation.h"
|
||||
#include "../serializer/JsonSerializeFormat.h"
|
||||
|
||||
#include <vstd/RNG.h>
|
||||
@ -83,6 +84,14 @@ void CRewardableObject::battleFinished(const CGHeroInstance *hero, const BattleR
|
||||
}
|
||||
}
|
||||
|
||||
void CRewardableObject::garrisonDialogClosed(const CGHeroInstance *hero) const
|
||||
{
|
||||
// if visitor received creatures as rewards, but does not have free slots, he will leave some units
|
||||
// inside rewardable object, which might get treated as guards later
|
||||
while(!stacks.empty())
|
||||
cb->eraseStack(StackLocation(id, stacks.begin()->first));
|
||||
}
|
||||
|
||||
void CRewardableObject::blockingDialogAnswered(const CGHeroInstance * hero, int32_t answer) const
|
||||
{
|
||||
if(isGuarded())
|
||||
|
Reference in New Issue
Block a user