Skip to content

Commit

Permalink
Add option to preserve scenario tag name with portmultiplayerscenario
Browse files Browse the repository at this point in the history
  • Loading branch information
jaron780 committed May 17, 2024
1 parent 67637ce commit 91a7fb5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TagTool/Commands/Porting/PortMultiplayerScenarioCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ public enum MultiplayerScenarioConversionFlags
SpawnPoint = (1 << 5),
[Description("Keep path finding data")]
PathFinding = (1 << 6),
[Description("Ported scenario will use levels\\custom\\")]
CustomScenarioPath = (1 << 7),

Default = Objects | DeviceObjects | SpawnPoint
Default = Objects | DeviceObjects | SpawnPoint | CustomScenarioPath
}

public PortMultiplayerScenarioCommand(GameCacheHaloOnlineBase cacheContext, GameCache blamCache, PortTagCommand portTag) :
Expand Down Expand Up @@ -104,7 +106,10 @@ public override object Execute(List<string> args)
if (!Regex.IsMatch(scenarioName, "[a-z0-9_]+"))
return new TagToolError(CommandError.CustomMessage, "Scenario name must consist of lowercase alphanumeric characters and underscores");

scenarioPath = $@"levels\custom\{scenarioName}\{scenarioName}";
if (conversionFlags.HasFlag(MultiplayerScenarioConversionFlags.CustomScenarioPath))
scenarioPath = $@"levels\custom\{scenarioName}\{scenarioName}";
else
scenarioPath = blamScnrTag.Name;

//
// try to parse the map id, if not use the randomly generated one unless it's actually invalid/out of range
Expand Down

0 comments on commit 91a7fb5

Please sign in to comment.