1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Fix object clearing

This commit is contained in:
nordsoft
2023-05-04 15:03:18 +04:00
parent 92dcfd1f68
commit 9984351302
3 changed files with 6 additions and 22 deletions

View File

@@ -71,9 +71,6 @@ void CGTownInstance::setPropertyDer(ui8 what, ui32 val)
case ObjProperty::REWARD_RANDOMIZE:
bonusingBuildings[val]->setProperty(ObjProperty::REWARD_RANDOMIZE, 0);
break;
case ObjProperty::REWARD_CLEARED:
bonusingBuildings[val]->setProperty(ObjProperty::REWARD_CLEARED, false);
break;
}
}
CGTownInstance::EFortLevel CGTownInstance::fortLevel() const //0 - none, 1 - fort, 2 - citadel, 3 - castle
@@ -506,15 +503,15 @@ void CGTownInstance::newTurn(CRandomGenerator & rand) const
for(const auto * manaVortex : getBonusingBuildings(BuildingSubID::MANA_VORTEX))
cb->setObjProperty(id, ObjProperty::STRUCTURE_CLEAR_VISITORS, manaVortex->indexOnTV); //reset visitors for Mana Vortex
//get Mana Vortex or Stables bonuses
//same code is in the CGameHandler::buildStructure method
if (visitingHero != nullptr)
cb->visitCastleObjects(this, visitingHero);
if (garrisonHero != nullptr)
cb->visitCastleObjects(this, garrisonHero);
if (tempOwner == PlayerColor::NEUTRAL) //garrison growth for neutral towns
{
std::vector<SlotID> nativeCrits; //slots
@@ -550,7 +547,7 @@ void CGTownInstance::newTurn(CRandomGenerator & rand) const
TQuantity count = creatureGrowth(i);
if (!count) // no dwelling
count = VLC->creh->objects[c]->getGrowth();
count = VLC->creatures()->getByIndex(c)->getGrowth();
{//no lower tiers or above current month