mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-17 11:56:46 +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
|
std::set<FactionID> CTownHandler::getAllowedFactions(bool withTown) const
|
||||||
{
|
{
|
||||||
if (!withTown)
|
if (withTown)
|
||||||
return getDefaultAllowed();
|
return getDefaultAllowed();
|
||||||
|
|
||||||
std::set<FactionID> result;
|
std::set<FactionID> result;
|
||||||
|
@ -32,7 +32,7 @@ FactionID PlayerSettings::getCastleValidated() const
|
|||||||
{
|
{
|
||||||
if (!castle.isValid())
|
if (!castle.isValid())
|
||||||
return FactionID(0);
|
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 castle;
|
||||||
|
|
||||||
return FactionID(0);
|
return FactionID(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user