mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 18:32:45 +00:00
PlayerTransformSync.LocalInstance should not be null when we SendEvent. if it is, i would like it to give an error, rather than simply wait
This commit is contained in:
parent
1ccd277c5c
commit
b538eb3200
@ -35,26 +35,24 @@ namespace QSB.Events
|
||||
|
||||
public abstract bool RequireWorldObjectsReady { get; }
|
||||
|
||||
public void SendEvent(T message) => QSBCore.UnityEvents.RunWhen(
|
||||
() => PlayerTransformSync.LocalInstance != null,
|
||||
() =>
|
||||
public void SendEvent(T message)
|
||||
{
|
||||
message.FromId = LocalPlayerId;
|
||||
if (QSBEventManager.ForIdOverride != uint.MaxValue)
|
||||
{
|
||||
message.FromId = LocalPlayerId;
|
||||
if (QSBEventManager.ForIdOverride != uint.MaxValue)
|
||||
{
|
||||
message.ForId = QSBEventManager.ForIdOverride;
|
||||
}
|
||||
if (message.OnlySendToHost)
|
||||
{
|
||||
message.ForId = 0;
|
||||
}
|
||||
new QSBEventRelay
|
||||
{
|
||||
To = message.ForId,
|
||||
Event = this,
|
||||
Message = message
|
||||
}.Send();
|
||||
});
|
||||
message.ForId = QSBEventManager.ForIdOverride;
|
||||
}
|
||||
if (message.OnlySendToHost)
|
||||
{
|
||||
message.ForId = 0;
|
||||
}
|
||||
new QSBEventRelay
|
||||
{
|
||||
To = message.ForId,
|
||||
Event = this,
|
||||
Message = message
|
||||
}.Send();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the message should be processed by the executing client.
|
||||
|
Loading…
x
Reference in New Issue
Block a user