Skip to content

Commit

Permalink
1.26.1 (#1039)
Browse files Browse the repository at this point in the history
## Bug fixes
- Fixed an oversight where any mod that changes the spawn (Archipelago
Randomizer and Play as Gabbro) would cause you to instantly die
- Fixed a pointless bug in EOTP that pikpik then fixed in EOTP also so
now this fix is redundant but I'm not removing it!
  • Loading branch information
xen-42 authored Feb 13, 2025
2 parents 9d9b538 + 9f5257d commit 778e75c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
16 changes: 9 additions & 7 deletions NewHorizons/Components/EyeOfTheUniverse/EyeMusicController.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using NewHorizons.Utility;
using NewHorizons.Utility.OWML;
using System.Collections;
using System.Collections.Generic;
Expand All @@ -17,7 +18,7 @@ public class EyeMusicController : MonoBehaviour
private bool _isPlaying;
private double _segmentEndAudioTime;
private float _segmentEndGameTime;
private CosmicInflationController _cosmicInflationController;
public CosmicInflationController CosmicInflationController { get; private set; }

public void RegisterLoopSource(OWAudioSource src)
{
Expand Down Expand Up @@ -59,9 +60,9 @@ public void TransitionToFinale()
}

// Set quantum sphere inflation timer
var finaleDuration = _cosmicInflationController._travelerFinaleSource.clip.length;
_cosmicInflationController._startFormationTime = Time.time;
_cosmicInflationController._finishFormationTime = finaleGameTime + finaleDuration - 4f;
var finaleDuration = CosmicInflationController._travelerFinaleSource.clip.length;
CosmicInflationController._startFormationTime = Time.time;
CosmicInflationController._finishFormationTime = finaleGameTime + finaleDuration - 4f;

// Play finale in sync
foreach (var finaleSrc in _finaleSources)
Expand All @@ -70,9 +71,10 @@ public void TransitionToFinale()
}
}

private void Awake()
public void Awake()
{
_cosmicInflationController = FindObjectOfType<CosmicInflationController>();
// EOTP makes 2 new CosmicInflationControllers for no reason
CosmicInflationController = SearchUtilities.Find("EyeOfTheUniverse_Body/Sector_EyeOfTheUniverse/Sector_Campfire/InflationController").GetComponent<CosmicInflationController>();
}

private IEnumerator DoLoop()
Expand Down Expand Up @@ -126,7 +128,7 @@ private IEnumerator DoLoop()
}

// Wait until the bubble has finished expanding
while (Time.time < _cosmicInflationController._finishFormationTime)
while (Time.time < CosmicInflationController._finishFormationTime)
{
yield return null;
}
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/Handlers/EyeSceneHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static void SetUpEyeCampfireSequence()
_eyeMusicController = new GameObject("EyeMusicController").AddComponent<EyeMusicController>();

var quantumCampsiteController = Object.FindObjectOfType<QuantumCampsiteController>();
var cosmicInflationController = Object.FindObjectOfType<CosmicInflationController>();
var cosmicInflationController = _eyeMusicController.CosmicInflationController;

_eyeMusicController.RegisterFinaleSource(cosmicInflationController._travelerFinaleSource);

Expand Down
11 changes: 7 additions & 4 deletions NewHorizons/Handlers/PlayerSpawnHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ public static void OnSystemReady(bool shouldWarpInFromShip, bool shouldWarpInFro
// Spawn ship
Delay.FireInNUpdates(SpawnShip, 30);

// Have had bug reports (#1034, #975) where sometimes after spawning via vessel warp or ship warp you die from impact velocity after being flung
// Something weird must be happening with velocity.
// Try to correct it here after the ship is done spawning
Delay.FireInNUpdates(() => FixVelocity(shouldWarpInFromVessel, shouldWarpInFromShip), 31);
if (UsingCustomSpawn() || shouldWarpInFromShip || shouldWarpInFromVessel)
{
// Have had bug reports (#1034, #975) where sometimes after spawning via vessel warp or ship warp you die from impact velocity after being flung
// Something weird must be happening with velocity.
// Try to correct it here after the ship is done spawning
Delay.FireInNUpdates(() => FixVelocity(shouldWarpInFromVessel, shouldWarpInFromShip), 31);
}
}

private static void FixVelocity(bool shouldWarpInFromVessel, bool shouldWarpInFromShip)
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends",
"name": "New Horizons",
"uniqueName": "xen.NewHorizons",
"version": "1.26.0",
"version": "1.26.1",
"owmlVersion": "2.12.1",
"dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
"conflicts": [ "PacificEngine.OW_CommonResources" ],
Expand Down

0 comments on commit 778e75c

Please sign in to comment.