1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Fix revisiting of cleared banks

This commit is contained in:
Ivan Savenko
2023-07-19 14:21:33 +03:00
parent 7f1b982264
commit 5660884ee5

View File

@@ -137,8 +137,9 @@ void CBank::onHeroVisit(const CGHeroInstance * h) const
{
std::map<CreatureID, int> guardsAmounts;
for (auto const & guard : bc->guards)
guardsAmounts[guard.getType()->getId()] += guard.getCount();
for (auto const & slot : Slots())
if (slot.second)
guardsAmounts[slot.second->getCreatureID()] += slot.second->getCount();
for (auto const & guard : guardsAmounts)
{