Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AssignStartingPlots:BalanceAndAssign()
- local iNumStarts = table.maxn(self.startingPlots);
- for region_number = 1, iNumStarts do
- self:NormalizeStartLocation(region_number)
- end
- local playerList = {};
- for loop = 1, self.iNumCivs do
- local player_ID = self.player_ID_list[loop];
- table.insert(playerList, player_ID);
- end
- local playerListShuffled = GetShuffledCopyOfTable(playerList)
- for region_number, player_ID in ipairs(playerListShuffled) do
- local x = self.startingPlots[region_number][1];
- local y = self.startingPlots[region_number][2];
- local start_plot = Map.GetPlot(x, y)
- local player = Players[player_ID]
- player:SetStartingPlot(start_plot)
- end
- if self.bTeamGame == true then
- self:NormalizeTeamLocations()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement