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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user