1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Do not select random towns as starting faction for player

This commit is contained in:
Ivan Savenko
2023-11-17 15:57:39 +02:00
parent 843e97349a
commit f9e6d1467f
2 changed files with 2 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ FactionID PlayerSettings::getCastleValidated() const
{
if (!castle.isValid())
return FactionID(0);
if (castle.getNum() < VLC->townh->size())
if (castle.getNum() < VLC->townh->size() && VLC->townh->objects[castle.getNum()]->town != nullptr)
return castle;
return FactionID(0);