This commit is contained in:
Mister_Nebula 2021-05-08 12:53:09 +01:00
parent 191396bfa4
commit 2c02a361ca
6 changed files with 21 additions and 7 deletions

View File

@ -21,7 +21,7 @@ namespace QSB.Animation.Player.Thrusters
// TODO : Make flames not appear underwater (Check original code!)
public void InitFromOld(Thruster thruster, Light light, AnimationCurve scaleByThrust, DampedSpring scaleSpring, float belowMaxThrustScalar, PlayerInfo player)
public void InitFromOld(Thruster thruster, Light light, AnimationCurve scaleByThrust, DampedSpring scaleSpring, float belowMaxThrustScalar, float baseLightRadius, PlayerInfo player)
{
_thruster = thruster;
_light = light;
@ -29,6 +29,7 @@ namespace QSB.Animation.Player.Thrusters
_scaleSpring = scaleSpring;
_belowMaxThrustScalar = belowMaxThrustScalar;
_attachedPlayer = player;
_baseLightRadius = baseLightRadius;
_isReady = true;
}
@ -36,7 +37,6 @@ namespace QSB.Animation.Player.Thrusters
{
_thrusterRenderer = GetComponent<MeshRenderer>();
_thrusterFilter = OWUtilities.GetShipThrusterFilter(_thruster);
_baseLightRadius = _light.range;
_currentScale = 0f;
_thrusterRenderer.enabled = false;
_light.enabled = false;

View File

@ -51,9 +51,10 @@ namespace QSB.Animation.Player.Thrusters
var oldAnimCurve = controller.GetValue<AnimationCurve>("_scaleByThrust");
var oldScaleSpring = controller.GetValue<DampedSpring>("_scaleSpring");
var oldScalar = controller.GetValue<float>("_belowMaxThrustScalar");
var oldBase = controller.GetValue<float>("_baseLightRadius");
Object.Destroy(controller);
var newObj = gameObject.AddComponent<RemoteThrusterFlameController>();
newObj.InitFromOld(oldThruster, oldLight, oldAnimCurve, oldScaleSpring, oldScalar, player);
newObj.InitFromOld(oldThruster, oldLight, oldAnimCurve, oldScaleSpring, oldScalar, oldBase, player);
}
}

View File

@ -42,8 +42,18 @@ namespace QSB.OrbSync.TransformSync
SetReferenceTransform(AttachedObject.GetAttachedOWRigidbody().GetOrigParent());
}
protected override GameObject InitLocalTransform() => QSBWorldSync.OldOrbList[_index].gameObject;
protected override GameObject InitRemoteTransform() => QSBWorldSync.OldOrbList[_index].gameObject;
private GameObject GetTransform()
{
if (QSBWorldSync.OldOrbList == null || QSBWorldSync.OldOrbList.Count <= _index)
{
DebugLog.ToConsole($"Error - OldOrbList is null or does not contain index {_index}.", OWML.Common.MessageType.Error);
return null;
}
return QSBWorldSync.OldOrbList[_index].gameObject;
}
protected override GameObject InitLocalTransform() => GetTransform();
protected override GameObject InitRemoteTransform() => GetTransform();
public override bool IsReady => _isReady;
public override bool UseInterpolation => false;

View File

@ -63,7 +63,6 @@ namespace QSB.QuantumSync.WorldObjects
var visibilityTrackers = AttachedObject.GetValue<VisibilityTracker[]>("_visibilityTrackers");
if (visibilityTrackers == null || visibilityTrackers.Length == 0)
{
DebugLog.ToConsole($"Warning - {AttachedObject.name} has null visibility trackers!", MessageType.Warning);
return new List<Shape>();
}
if (visibilityTrackers.Any(x => x.GetType() == typeof(RendererVisibilityTracker)))

View File

@ -32,6 +32,10 @@ namespace QSB.Syncs.TransformSync
protected override void Init()
{
base.Init();
if (!QSBSectorManager.Instance.IsReady)
{
return;
}
var closestSector = SectorSync.GetClosestSector(AttachedObject.transform);
if (closestSector != null)
{

View File

@ -4,6 +4,6 @@
"name": "Quantum Space Buddies",
"description": "Adds online multiplayer to the game.",
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
"version": "0.10.1",
"version": "0.11.0",
"owmlVersion": "1.1.8"
}