mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-28 00:19:27 +00:00
better QSBPatch.Remote
This commit is contained in:
parent
934e761386
commit
25900cbc2f
@ -11,7 +11,7 @@ public abstract class QSBPatch
|
||||
public void DoPatches(Harmony instance) => instance.PatchAll(GetType());
|
||||
|
||||
/// <summary>
|
||||
/// this is true when a message is received remotely (OnReceiveRemote) or a player leaves (OnRemovePlayer)
|
||||
/// this is true when a message is received remotely (OnReceiveRemote) or a remote player joins/leaves (OnAddPlayer/OnRemovePlayer)
|
||||
/// </summary>
|
||||
public static bool Remote;
|
||||
}
|
||||
|
@ -36,7 +36,9 @@ public class PlayerTransformSync : SectoredTransformSync
|
||||
var player = new PlayerInfo(this);
|
||||
QSBPlayerManager.PlayerList.SafeAdd(player);
|
||||
base.OnStartClient();
|
||||
QSBPatch.Remote = !isLocalPlayer;
|
||||
QSBPlayerManager.OnAddPlayer?.SafeInvoke(Player);
|
||||
QSBPatch.Remote = false;
|
||||
DebugLog.DebugWrite($"Create Player : {Player}", MessageType.Info);
|
||||
|
||||
JoinLeaveSingularity.Create(Player, true);
|
||||
@ -49,7 +51,7 @@ public class PlayerTransformSync : SectoredTransformSync
|
||||
JoinLeaveSingularity.Create(Player, false);
|
||||
|
||||
// TODO : Maybe move this to a leave event...? Would ensure everything could finish up before removing the player
|
||||
QSBPatch.Remote = true;
|
||||
QSBPatch.Remote = !isLocalPlayer;
|
||||
QSBPlayerManager.OnRemovePlayer?.SafeInvoke(Player);
|
||||
QSBPatch.Remote = false;
|
||||
base.OnStopClient();
|
||||
|
Loading…
Reference in New Issue
Block a user