1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +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

@@ -570,7 +570,7 @@ void ApplyClientNetPackVisitor::visitSetHeroesInTown(SetHeroesInTown & pack)
//inform all players that see this object
for(auto i = cl.playerint.cbegin(); i != cl.playerint.cend(); ++i)
{
if(i->first >= PlayerColor::PLAYER_LIMIT)
if(!i->first.isValidPlayer())
continue;
if(gs.isVisible(t, i->first) ||