Skip to content

Commit c715cc6

Browse files
FlamefireFlow86
authored andcommitted
Fix placing HQs randomly
1 parent bab98a4 commit c715cc6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

libs/s25main/world/MapLoader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ bool MapLoader::Load(const boost::filesystem::path& mapFilePath)
7979

8080
if(!Load(map, world_.GetGGS().exploration))
8181
return false;
82-
std::vector<MapPoint> hqPositions = hqPositions_;
83-
if(world_.GetGGS().randomStartPosition)
84-
RANDOM_SHUFFLE2(hqPositions, 0);
8582
if(!PlaceHQs())
8683
return false;
8784

@@ -103,7 +100,10 @@ bool MapLoader::LoadLuaScript(Game& game, ILocalGameState& localgameState, const
103100

104101
bool MapLoader::PlaceHQs(bool addStartWares)
105102
{
106-
return PlaceHQs(world_, hqPositions_, addStartWares);
103+
std::vector<MapPoint> hqPositions = hqPositions_;
104+
if(world_.GetGGS().randomStartPosition)
105+
RANDOM_SHUFFLE2(hqPositions, 0);
106+
return PlaceHQs(world_, hqPositions, addStartWares);
107107
}
108108

109109
void MapLoader::InitShadows(World& world)

0 commit comments

Comments
 (0)