1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Use enum instead of mix of bool's and int's for tile reveal

This commit is contained in:
Ivan Savenko
2023-10-04 15:31:42 +03:00
parent 98fd939ed6
commit dd841bdaa7
16 changed files with 55 additions and 58 deletions

View File

@ -346,7 +346,7 @@ void PlayerMessageProcessor::cheatDefeat(PlayerColor player)
void PlayerMessageProcessor::cheatMapReveal(PlayerColor player, bool reveal)
{
FoWChange fc;
fc.mode = reveal ? FoWChange::Mode::REVEAL : FoWChange::Mode::HIDE;
fc.mode = reveal ? ETileVisibility::REVEALED : ETileVisibility::HIDDEN;
fc.player = player;
const auto & fowMap = gameHandler->gameState()->getPlayerTeam(player)->fogOfWarMap;
const auto & mapSize = gameHandler->gameState()->getMapSize();
@ -356,7 +356,7 @@ void PlayerMessageProcessor::cheatMapReveal(PlayerColor player, bool reveal)
for(int z = 0; z < mapSize.z; z++)
for(int x = 0; x < mapSize.x; x++)
for(int y = 0; y < mapSize.y; y++)
if(!(*fowMap)[z][x][y] || fc.mode == FoWChange::Mode::HIDE)
if(!(*fowMap)[z][x][y] || fc.mode == ETileVisibility::HIDDEN)
hlp_tab[lastUnc++] = int3(x, y, z);
fc.tiles.insert(hlp_tab, hlp_tab + lastUnc);