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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user