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

Refactoring of spell animations, multiple fixes for spell visuals

This commit is contained in:
Ivan Savenko
2022-12-01 22:06:42 +02:00
parent 92ca0d9877
commit 5094fab4d9
16 changed files with 717 additions and 562 deletions

View File

@@ -756,21 +756,24 @@ void CPlayerInterface::battleObstaclesChanged(const std::vector<ObstacleChanges>
EVENT_HANDLER_CALLED_BY_CLIENT;
BATTLE_EVENT_POSSIBLE_RETURN;
std::vector<std::shared_ptr<const CObstacleInstance>> newObstacles;
for(auto & change : obstacles)
{
if(change.operation == BattleChanges::EOperation::ADD)
{
auto instance = cb->battleGetObstacleByID(change.id);
if(instance)
battleInt->obstaclePlaced(*instance);
newObstacles.push_back(instance);
else
logNetwork->error("Invalid obstacle instance %d", change.id);
}
else
{
battleInt->fieldController->redrawBackgroundWithHexes();
}
}
if (!newObstacles.empty())
battleInt->obstaclePlaced(newObstacles);
battleInt->fieldController->redrawBackgroundWithHexes();
}
void CPlayerInterface::battleCatapultAttacked(const CatapultAttack & ca)