Skip to content

Commit 9c00455

Browse files
committed
2.5.6 tp fix
1 parent 5ec5f6f commit 9c00455

File tree

5 files changed

+38
-17
lines changed

5 files changed

+38
-17
lines changed

Bootstrap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public partial class GS2
1515
}
1616

1717

18-
[BepInPlugin("dsp.galactic-scale.2", "Galactic Scale 2 Plug-In", "2.5.5")]
18+
[BepInPlugin("dsp.galactic-scale.2", "Galactic Scale 2 Plug-In", "2.5.6")]
1919
[BepInDependency("space.customizing.console", BepInDependency.DependencyFlags.SoftDependency)]
2020
[BepInDependency("dsp.nebula-multiplayer-api", BepInDependency.DependencyFlags.SoftDependency)]
2121
public class Bootstrap : BaseUnityPlugin

GalacticScale3.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PropertyGroup>
99
<AssemblyName>GalacticScale</AssemblyName>
1010
<Description>Galaxy Customization for Dyson Sphere Program</Description>
11-
<Version>2.5.5</Version>
11+
<Version>2.5.6</Version>
1212
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1313
<LangVersion>9.0</LangVersion>
1414
<OutDir>bin/$(Configuration)</OutDir>

Package/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# DSP Galactic Scale 2.0 Mod
22

33
# BACKUP YOUR SAVES
4+
- Version 2.5.6 - Improve Teleportation Functionality
45
- Version 2.5.5 - Fix Mecha Scaling when teleporting and add debug scale value for funsies.
56
- Version 2.5.4 - Fix Vanilla Generator Saves
67
- Version 2.5.3 - Added some missing code from recent updates that dpmm99 discovered

Scripts/Functionality/Teleport/TeleportComponent.cs

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ public class TeleportComponent : MonoBehaviour
88
public PlanetData TargetPlanet;
99
public StarData TargetStar;
1010
public bool TeleportEnabled;
11-
11+
public int ticker = 0;
1212
public void FixedUpdate()
1313
{
14+
ticker++;
15+
if (ticker > 60)
16+
{
17+
GS2.Warn(
18+
$"FU: TP:{TargetPlanet != null} TS:{TargetStar != null} TE:{TeleportEnabled} LS:{GameMain.localStar != null} LSL{GameMain.localStar?.loaded}");
19+
ticker = 0;
20+
}
21+
else return;
1422
if (!GS2.Config.CheatMode) return;
1523
if (DSPGame.IsMenuDemo) return;
1624
if (TargetStar == null && TargetPlanet == null || TeleportEnabled == false || !(GameMain.localStar != null && GameMain.localStar.loaded)) return;
@@ -30,32 +38,44 @@ public void FixedUpdate()
3038
}
3139
private IEnumerator Teleport(PlanetData planet)
3240
{
41+
GS2.Warn($"Teleporting to {planet.name}");
3342
yield return new WaitForEndOfFrame();
34-
yield return new WaitForSeconds(0.1f);
35-
TargetPlanet = null;
36-
TargetStar = null;
3743
GameMain.mainPlayer.uPosition = planet.uPosition + VectorLF3.unit_z * planet.realRadius;
44+
yield return new WaitForEndOfFrame();
3845
GameMain.data.mainPlayer.movementState = EMovementState.Sail;
39-
TeleportEnabled = false;
40-
GameMain.mainPlayer.transform.localScale = Vector3.one;
41-
yield return new WaitForSeconds(1);
46+
yield return new WaitForEndOfFrame();
47+
GameCamera.instance.FrameLogic();
48+
yield return new WaitForEndOfFrame();
4249
GameMain.mainPlayer.transform.localScale = Vector3.one * GS2.Config.MechaScale;
43-
50+
if (GameMain.localPlanet == planet)
51+
{
52+
TargetPlanet = null;
53+
TargetStar = null;
54+
TeleportEnabled = false;
55+
}
4456
}
4557

4658
private IEnumerator Teleport(StarData star)
4759
{
60+
4861
yield return new WaitForEndOfFrame();
49-
yield return new WaitForSeconds(0.1f);
50-
TargetPlanet = null;
51-
TargetStar = null;
62+
// yield return new WaitForSeconds(0.2f);
63+
5264
GameMain.mainPlayer.uPosition = star.uPosition + VectorLF3.unit_z * 1;
65+
yield return new WaitForEndOfFrame();
5366
GameMain.data.mainPlayer.movementState = EMovementState.Sail;
54-
TeleportEnabled = false;
67+
yield return new WaitForEndOfFrame();
5568
GameMain.mainPlayer.transform.localScale = Vector3.one;
69+
yield return new WaitForEndOfFrame();
5670
GameCamera.instance.FrameLogic();
57-
yield return new WaitForSeconds(1);
71+
yield return new WaitForEndOfFrame();
5872
GameMain.mainPlayer.transform.localScale = Vector3.one * GS2.Config.MechaScale;
73+
if (GameMain.localStar == star)
74+
{
75+
TargetPlanet = null;
76+
TargetStar = null;
77+
TeleportEnabled = false;
78+
}
5979
}
6080

6181
public bool NavArrowClick(UIStarmap starmap)

thunderstore.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ schemaVersion = "0.0.1"
44
[package]
55
namespace = "Galactic_Scale"
66
name = "GalacticScale"
7-
versionNumber = "2.5.5"
8-
description = "v2.5.5 BACKUP SAVES!!! Fix Vanilla Generator Saves"
7+
versionNumber = "2.5.6"
8+
description = "v2.5.6 Better Teleporting"
99
websiteUrl = "https://github.com/innominata/GalacticScale3"
1010
containsNsfwContent = false
1111

0 commit comments

Comments
 (0)