Skip to content

Commit 19c7851

Browse files
committed
startPosType=2 so multiple teams can be used with generated maps (and actually properly load all teams)
1 parent 2aeff73 commit 19c7851

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

scen_edit/command/project/reload_into_project_command.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function ReloadIntoProjectCommand:execute()
4141
scriptObj.modOptions._sb_game_version = nil
4242
scriptObj.players = scriptObj.players or {}
4343
scriptObj.ais = scriptObj.ais or {}
44+
scriptObj.startPosType = 2
4445

4546
table.echo(scriptObj)
4647
scriptTxt = StartScript.GenerateScriptTxt(scriptObj)

scen_edit/command/project/save_project_info_command.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function SaveCommand.GenerateScript()
6161
-- we ignore SB's teamIDs and make sure they make a no-gap array
6262
local teamIDCount = 1
6363
for _, team in pairs(SB.model.teamManager:getAllTeams()) do
64-
if not team.gaia and #players + #ais < 2 then
64+
if not team.gaia then
6565
local t = {
6666
-- TeamID = team.id, ID is implicit as index-1
6767
teamLeader = 0,
@@ -121,6 +121,7 @@ function SaveCommand.GenerateScript()
121121
ais = ais,
122122
teams = teams,
123123
allyTeams = allyTeams,
124+
startPosType = 2,
124125
}
125126
return StartScript.GenerateScriptTxt(script)
126127
end
@@ -156,6 +157,10 @@ local function MapInfoSave(name, path)
156157
end
157158

158159
function SaveProjectInfoCommand:execute()
160+
if #SB.project.mutators == 0 then
161+
SB.project.mutators = { SB.project.name .. " 1.0" }
162+
end
163+
159164
local projectDir = self.path
160165
local projectName = self.name
161166

scen_edit/model/project.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function Project:Save(name)
4141
assert(self.path ~= nil, "Project path is not specified")
4242
assert(self.name ~= nil, "Project name is not specified")
4343
if isNewProject then
44-
SB.project:CreateProjectStructure(self.path)
44+
self:GenerateNewProjectInfo(self.name)
4545
end
4646

4747
Log.Notice("Saving project: " .. self.path .. " ...")
@@ -70,6 +70,7 @@ function Project:GenerateNewProjectInfo(name)
7070
self.path = nil
7171
self:__MaybeSetNameCommand(name)
7272

73+
SB.project.mutators = { SB.project.name .. " 1.0" }
7374
SB.project:CreateProjectStructure(self.path)
7475
Log.Notice("Saving project info: " .. self.path .. " ...")
7576
local cmd = SaveProjectInfoCommand(self.name, self.path, true)

scen_edit/view/dialog/new_project_dialog.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ function NewProjectDialog:ConfirmDialog()
9393
return
9494
end
9595

96-
SB.project.mutators = { projectName .. " 1.0" }
9796
if self.fields["mapName"].value == "SB_Blank_Map" then
9897
if self.fields["sizeX"].value % 2 ~= 0 then
9998
SB.HintControls(self.fields["sizeX"].components)

0 commit comments

Comments
 (0)