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

Fixed initialization of move points and mana for dismissed heroes

This commit is contained in:
Ivan Savenko
2024-01-15 22:25:52 +02:00
parent 03675e1c48
commit c21913f661
10 changed files with 29 additions and 8 deletions

View File

@@ -74,6 +74,7 @@ void HeroPoolProcessor::onHeroSurrendered(const PlayerColor & color, const CGHer
sah.slotID = selectSlotForRole(color, sah.roleID);
sah.player = color;
sah.hid = hero->getHeroType();
sah.replenishPoints = false;
gameHandler->sendAndApply(&sah);
}
@@ -87,6 +88,7 @@ void HeroPoolProcessor::onHeroEscaped(const PlayerColor & color, const CGHeroIns
sah.hid = hero->getHeroType();
sah.army.clearSlots();
sah.army.setCreature(SlotID(0), hero->type->initialArmy.at(0).creature, 1);
sah.replenishPoints = false;
gameHandler->sendAndApply(&sah);
}
@@ -98,6 +100,7 @@ void HeroPoolProcessor::clearHeroFromSlot(const PlayerColor & color, TavernHeroS
sah.roleID = TavernSlotRole::NONE;
sah.slotID = slot;
sah.hid = HeroTypeID::NONE;
sah.replenishPoints = false;
gameHandler->sendAndApply(&sah);
}
@@ -106,6 +109,7 @@ void HeroPoolProcessor::selectNewHeroForSlot(const PlayerColor & color, TavernHe
SetAvailableHero sah;
sah.player = color;
sah.slotID = slot;
sah.replenishPoints = true;
CGHeroInstance *newHero = pickHeroFor(needNativeHero, color);
@@ -129,6 +133,7 @@ void HeroPoolProcessor::selectNewHeroForSlot(const PlayerColor & color, TavernHe
{
sah.hid = HeroTypeID::NONE;
}
gameHandler->sendAndApply(&sah);
}