mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-18 17:40:48 +02:00
Safety checks
This commit is contained in:
parent
dc65d1c2b6
commit
b284652f71
@ -46,7 +46,7 @@ PlayerParams::PlayerParams(MapController & ctrl, int playerId, QWidget *parent)
|
||||
for(int i = 0; i < controller.map()->towns.size(); ++i)
|
||||
{
|
||||
auto town = controller.map()->towns[i];
|
||||
if(town->getOwner().getNum() == playerColor)
|
||||
if(town && town->town && town->town->faction && town->getOwner().getNum() == playerColor)
|
||||
{
|
||||
if(playerInfo.hasMainTown && playerInfo.posOfMainTown == town->pos)
|
||||
foundMainTown = i;
|
||||
|
Loading…
Reference in New Issue
Block a user