mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
fix invocation and other errors
This commit is contained in:
parent
a4184f921c
commit
c5d8a25922
@ -25,6 +25,11 @@ namespace QSB.QuantumSync.Events
|
||||
|
||||
public override bool CheckMessage(bool isServer, QuantumAuthorityMessage message)
|
||||
{
|
||||
if (!QSBCore.HasWokenUp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var objects = QSBWorldSync.GetWorldObjects<IQSBQuantumObject>();
|
||||
var obj = objects.ToList()[message.ObjectId];
|
||||
|
||||
|
@ -3,6 +3,7 @@ using QSB.Player;
|
||||
using QSB.TransformSync;
|
||||
using QuantumUNET;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.Utility
|
||||
@ -51,9 +52,9 @@ namespace QSB.Utility
|
||||
{
|
||||
del.DynamicInvoke(args);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (TargetInvocationException ex)
|
||||
{
|
||||
DebugLog.ToConsole($"Error invoking delegate! Message : {ex.Message} Stack Trace : {Environment.NewLine}{ex.StackTrace}", MessageType.Error);
|
||||
DebugLog.ToConsole($"Error invoking delegate! Message : {ex.InnerException.Message} Stack Trace : {ex.InnerException.StackTrace}", MessageType.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,11 +13,17 @@ namespace QSB.Utility
|
||||
|
||||
private ComponentState _wasEnabled = ComponentState.NotChecked;
|
||||
|
||||
public OnEnableDisableTracker()
|
||||
=> QSBSceneManager.OnSceneLoaded += (OWScene scene, bool inUniverse) => Destroy(this);
|
||||
|
||||
private void OnDestroy()
|
||||
=> QSBSceneManager.OnSceneLoaded -= (OWScene scene, bool inUniverse) => Destroy(this);
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (AttachedComponent == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Attached component is null! Attached to {gameObject.name}", OWML.Common.MessageType.Error);
|
||||
DebugLog.ToConsole($"Attached component is null!", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
var state = AttachedComponent.isActiveAndEnabled ? ComponentState.Enabled : ComponentState.Disabled;
|
||||
|
Loading…
x
Reference in New Issue
Block a user