Skip to content

Commit

Permalink
fix minor porting issues with PortMultiplayerScenario
Browse files Browse the repository at this point in the history
  • Loading branch information
jaron780 committed May 14, 2024
1 parent b0da739 commit 0cafcaf
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions TagTool/Commands/Porting/PortMultiplayerScenarioCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ int ParseConversionFlags(List<string> args, out MultiplayerScenarioConversionFla
if (arg.Length > 1)
{
not = arg[0] == '!';
flagName = arg.Substring(1);
if (not)
flagName = arg.Substring(1);
else
flagName = arg;
}


Expand Down Expand Up @@ -475,9 +478,6 @@ public void Convert(Stream destStream, GameCacheHaloOnlineBase destCache, Stream
if (conversionFlags.HasFlag(MultiplayerScenarioConversionFlags.SpawnPoint))
AddRespawnPoint(scnr, 0, spawnPoint, new RealEulerAngles3d());

// add the prematch camera
AddPrematchCamera(scnr, spawnPoint + new RealPoint3d(0, 0, 0.62f), new RealEulerAngles3d());

// add generic player starting profile
AddPlayerStartingProfile(scnr);

Expand Down Expand Up @@ -524,17 +524,6 @@ void GenerateMapFile(Stream cacheStream, GameCache cache, CachedTag scenarioTag,
}
}

private void AddPrematchCamera(Scenario scnr, RealPoint3d position, RealEulerAngles3d rotation)
{
scnr.CutsceneCameraPoints.Add(new CutsceneCameraPoint()
{
Position = position,
Orientation = rotation,
Flags = CutsceneCameraPointFlags.PrematchCameraHack,
Name = "prematch_camera",
});
}

private void AddRespawnPoint(Scenario scnr, int bspIndex, RealPoint3d position, RealEulerAngles3d rotation)
{
var instance = new SceneryInstance();
Expand Down Expand Up @@ -707,7 +696,12 @@ public void Convert()
Scenario.Scripts?.Clear();
Scenario.Globals?.Clear();
Scenario.CutsceneFlags?.Clear();
Scenario.CutsceneCameraPoints?.Clear();
for(int i = Scenario.CutsceneCameraPoints.Count - 1; i >= 0; i--)
{
var cameraPoint = Scenario.CutsceneCameraPoints[i];
if(cameraPoint.Name!= "prematch_camera" && cameraPoint.Name != "podium_camera")
Scenario.CutsceneCameraPoints.RemoveAt(i);
}
Scenario.Cinematics?.Clear();
Scenario.CinematicLighting?.Clear();
Scenario.CutsceneTitles?.Clear();
Expand Down

0 comments on commit 0cafcaf

Please sign in to comment.