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

Fix most of memleaks discovered by valgrind

This commit is contained in:
Ivan Savenko
2023-11-13 12:09:55 +02:00
parent 1192dbff15
commit 20ef3a69e7
18 changed files with 58 additions and 27 deletions

View File

@@ -932,7 +932,7 @@ void SetMovePoints::applyGs(CGameState * gs) const
void FoWChange::applyGs(CGameState *gs)
{
TeamState * team = gs->getPlayerTeam(player);
auto fogOfWarMap = team->fogOfWarMap;
auto & fogOfWarMap = team->fogOfWarMap;
for(const int3 & t : tiles)
(*fogOfWarMap)[t.z][t.x][t.y] = mode != ETileVisibility::HIDDEN;
@@ -1327,7 +1327,7 @@ void TryMoveHero::applyGs(CGameState *gs)
gs->map->addBlockVisTiles(h);
}
auto fogOfWarMap = gs->getPlayerTeam(h->getOwner())->fogOfWarMap;
auto & fogOfWarMap = gs->getPlayerTeam(h->getOwner())->fogOfWarMap;
for(const int3 & t : fowRevealed)
(*fogOfWarMap)[t.z][t.x][t.y] = 1;
}