mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Do not select random towns as starting faction for player
This commit is contained in:
parent
843e97349a
commit
f9e6d1467f
@ -1272,7 +1272,7 @@ std::set<FactionID> CTownHandler::getDefaultAllowed() const
|
||||
|
||||
std::set<FactionID> CTownHandler::getAllowedFactions(bool withTown) const
|
||||
{
|
||||
if (!withTown)
|
||||
if (withTown)
|
||||
return getDefaultAllowed();
|
||||
|
||||
std::set<FactionID> result;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user