1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Fix checking PlayerColor's for validness

This commit is contained in:
Ivan Savenko
2023-08-27 01:35:38 +03:00
parent 3b06abd0d7
commit ce20d913e0
25 changed files with 55 additions and 49 deletions

View File

@@ -227,7 +227,7 @@ void Graphics::blueToPlayersAdv(QImage * sur, PlayerColor player)
if(sur->format() == QImage::Format_Indexed8)
{
auto palette = sur->colorTable();
if(player < PlayerColor::PLAYER_LIMIT)
if(player.isValidPlayer())
{
for(int i = 0; i < 32; ++i)
palette[224 + i] = playerColorPalette[player.getNum() * 32 + i];