mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-04 03:39:55 +00:00
Merge pull request #386 from misternebula/separate-out-stuff
angler/meteor stuff
This commit is contained in:
commit
7086e5aed5
@ -24,10 +24,7 @@ namespace QSB.Anglerfish.Events
|
||||
LocalDisturbancePos = qsbAngler.AttachedObject._localDisturbancePos
|
||||
};
|
||||
|
||||
public override void OnReceiveLocal(bool isHost, AnglerChangeStateMessage message) => OnReceive(message);
|
||||
public override void OnReceiveRemote(bool isHost, AnglerChangeStateMessage message) => OnReceive(message);
|
||||
|
||||
private static void OnReceive(AnglerChangeStateMessage message)
|
||||
public override void OnReceiveRemote(bool isHost, AnglerChangeStateMessage message)
|
||||
{
|
||||
if (!QSBCore.WorldObjectsReady)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace QSB.Anglerfish.Patches
|
||||
{
|
||||
if (!QSBCore.WorldObjectsReady)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
var qsbAngler = QSBWorldSync.GetWorldFromUnity<QSBAngler>(__instance);
|
||||
|
||||
@ -78,7 +78,7 @@ namespace QSB.Anglerfish.Patches
|
||||
{
|
||||
if (!QSBCore.WorldObjectsReady)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
var qsbAngler = QSBWorldSync.GetWorldFromUnity<QSBAngler>(__instance);
|
||||
|
||||
@ -173,7 +173,7 @@ namespace QSB.Anglerfish.Patches
|
||||
{
|
||||
if (!QSBCore.WorldObjectsReady)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
var qsbAngler = QSBWorldSync.GetWorldFromUnity<QSBAngler>(__instance);
|
||||
qsbAngler.UpdateTargetVelocity();
|
||||
|
@ -46,6 +46,12 @@ namespace QSB.Anglerfish.TransformSync
|
||||
public override void DeserializeTransform(QNetworkReader reader, bool initialState)
|
||||
{
|
||||
base.DeserializeTransform(reader, initialState);
|
||||
|
||||
if (!QSBCore.WorldObjectsReady || HasAuthority)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_shouldUpdate = true;
|
||||
}
|
||||
|
||||
@ -67,17 +73,32 @@ namespace QSB.Anglerfish.TransformSync
|
||||
|
||||
protected override void OnRenderObject()
|
||||
{
|
||||
base.OnRenderObject();
|
||||
|
||||
if (!QSBCore.WorldObjectsReady
|
||||
|| !QSBCore.ShowLinesInDebug
|
||||
|| !IsReady
|
||||
|| ReferenceTransform == null)
|
||||
|| ReferenceTransform == null
|
||||
|| ((OWRigidbody)AttachedObject).IsSuspended())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Popcron.Gizmos.Line(AttachedObject.transform.position, _qsbAngler.AttachedObject.GetTargetPosition(), Color.white);
|
||||
base.OnRenderObject();
|
||||
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position, _qsbAngler.AttachedObject._arrivalDistance, Color.blue);
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position, _qsbAngler.AttachedObject._pursueDistance, Color.red);
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position, _qsbAngler.AttachedObject._escapeDistance, Color.yellow);
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position
|
||||
+ AttachedObject.transform.TransformDirection(_qsbAngler.AttachedObject._mouthOffset), 3, Color.grey);
|
||||
|
||||
if (_qsbAngler.TargetTransform != null)
|
||||
{
|
||||
Popcron.Gizmos.Line(_qsbAngler.TargetTransform.position, ((OWRigidbody)AttachedObject).GetPosition(), Color.gray);
|
||||
Popcron.Gizmos.Line(_qsbAngler.TargetTransform.position, _qsbAngler.TargetTransform.position + _qsbAngler.TargetVelocity, Color.green);
|
||||
Popcron.Gizmos.Line(((OWRigidbody)AttachedObject).GetPosition(), _qsbAngler.AttachedObject._targetPos, Color.red);
|
||||
Popcron.Gizmos.Sphere(_qsbAngler.AttachedObject._targetPos, 5, Color.red);
|
||||
}
|
||||
|
||||
// Popcron.Gizmos.Line(AttachedObject.transform.position, _qsbAngler.AttachedObject.GetTargetPosition(), Color.white);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
@ -1,12 +1,12 @@
|
||||
ManifestFileVersion: 0
|
||||
CRC: 1923832523
|
||||
CRC: 551896829
|
||||
Hashes:
|
||||
AssetFileHash:
|
||||
serializedVersion: 2
|
||||
Hash: 81ec87f15e23d40065c2c9c6a04728d0
|
||||
Hash: 0fa5758f55c8803c7ba77a52ab2c9488
|
||||
TypeTreeHash:
|
||||
serializedVersion: 2
|
||||
Hash: 0f787b84b284b04ad8bc62b6e0ef5423
|
||||
Hash: 927887737c4cf3ead147733f47326ca9
|
||||
HashAppended: 0
|
||||
ClassTypes:
|
||||
- Class: 1
|
||||
@ -29,6 +29,8 @@ ClassTypes:
|
||||
Script: {fileID: -1164351254, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: -1309757293, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: 316226861, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: 78926581, guid: 27687deae413b90448366870cb0de502, type: 3}
|
||||
- Class: 114
|
||||
@ -47,6 +49,7 @@ ClassTypes:
|
||||
Script: {instanceID: 0}
|
||||
SerializeReferenceClassIdentifiers: []
|
||||
Assets:
|
||||
- Assets/Prefabs/NetworkJellyfish.prefab
|
||||
- Assets/Prefabs/NetworkProbe.prefab
|
||||
- Assets/Prefabs/NETWORK_Player_Body.prefab
|
||||
- Assets/Prefabs/NetworkOrb.prefab
|
||||
|
@ -150,7 +150,7 @@ namespace QSB.MeteorSync.Patches
|
||||
}
|
||||
if (!MeteorManager.Ready)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
var qsbFragment = QSBWorldSync.GetWorldFromUnity<QSBFragment>(__instance._detachableFragment._fragmentIntegrity);
|
||||
|
@ -17,7 +17,7 @@ namespace QSB.MeteorSync.Patches
|
||||
{
|
||||
if (!MeteorManager.Ready)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (__instance._launchedMeteors != null)
|
||||
@ -204,7 +204,7 @@ namespace QSB.MeteorSync.Patches
|
||||
}
|
||||
if (!MeteorManager.Ready)
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
var qsbFragment = QSBWorldSync.GetWorldFromUnity<QSBFragment>(__instance._detachableFragment._fragmentIntegrity);
|
||||
|
@ -1,4 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
using OWML.Common;
|
||||
using QSB.Anglerfish.Patches;
|
||||
using QSB.Animation.NPC.Patches;
|
||||
@ -27,9 +30,6 @@ using QSB.Tools.SignalscopeTool.FrequencySync.Patches;
|
||||
using QSB.Tools.TranslatorTool.TranslationSync.Patches;
|
||||
using QSB.Utility;
|
||||
using QSB.ZeroGCaveSync.Patches;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace QSB.Patches
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
using OWML.Common;
|
||||
using System.Linq;
|
||||
using OWML.Common;
|
||||
using OWML.ModHelper;
|
||||
using OWML.ModHelper.Input;
|
||||
using QSB.Anglerfish;
|
||||
@ -32,7 +33,6 @@ using QSB.WorldSync;
|
||||
using QSB.ZeroGCaveSync;
|
||||
using QuantumUNET;
|
||||
using QuantumUNET.Components;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
/*
|
||||
|
@ -162,7 +162,7 @@ namespace QSB.Syncs.Unsectored.Rigidbodies
|
||||
_prevAngularVelocity);
|
||||
|
||||
// OPTIMIZE : optimize by using sqrMagnitude
|
||||
private bool CustomHasMoved(
|
||||
internal bool CustomHasMoved(
|
||||
Vector3 newPosition,
|
||||
Vector3 prevPosition,
|
||||
Quaternion newRotation,
|
||||
|
@ -10,6 +10,7 @@ namespace QSB.WorldSync
|
||||
{
|
||||
private static readonly List<WorldObjectManager> _managers = new();
|
||||
|
||||
// BUG : this gets set to true even if the objects aren't technically ready (i.e. they wait for something else)
|
||||
public static bool AllReady { get; private set; }
|
||||
|
||||
public virtual void Awake()
|
||||
|
Loading…
x
Reference in New Issue
Block a user