more fixes, my god

This commit is contained in:
Mister_Nebula 2021-10-25 16:31:15 +01:00
parent 01d87df804
commit 8943dc76b5
3 changed files with 17 additions and 6 deletions

View File

@ -24,12 +24,12 @@ namespace QSB.OrbSync
private void BuildOrbs()
{
QSBWorldSync.OldOrbList.Clear();
NomaiOrbTransformSync.OrbTransformSyncs.Clear();
QSBWorldSync.OldOrbList = Resources.FindObjectsOfTypeAll<NomaiInterfaceOrb>().ToList();
if (QSBCore.IsHost)
{
_orbs.ForEach(x => QNetworkServer.Destroy(x));
_orbs.Clear();
NomaiOrbTransformSync.OrbTransformSyncs.Clear();
foreach (var orb in QSBWorldSync.OldOrbList)
{
var newOrb = Instantiate(QSBNetworkManager.Instance.OrbPrefab);

View File

@ -23,11 +23,17 @@ namespace QSB.OrbSync.TransformSync
protected override void Init()
{
if (!OrbTransformSyncs.Contains(this))
{
OrbTransformSyncs.Add(this);
}
base.Init();
if (AttachedObject == null)
{
DebugLog.ToConsole($"Error - Trying to init orb with null AttachedObject.", MessageType.Error);
return;
}
var originalParent = AttachedObject.GetAttachedOWRigidbody().GetOrigParent();
@ -61,11 +67,6 @@ namespace QSB.OrbSync.TransformSync
return null;
}
if (QSBWorldSync.OldOrbList.Count != OrbTransformSyncs.Count)
{
DebugLog.ToConsole($"Warning - OldOrbList count ({QSBWorldSync.OldOrbList.Count}) does not equal OrbTransformSyncs count ({OrbTransformSyncs.Count})!", MessageType.Warning);
}
return QSBWorldSync.OldOrbList[_index].transform;
}

View File

@ -255,6 +255,16 @@ namespace QSB.TimeSync
}
}
if (serverState == ServerState.WaitingForAllPlayersToDie && clientState == ClientState.WaitingForOthersToReadyInSolarSystem)
{
if (CurrentState == State.Pausing && (PauseReason)CurrentReason == PauseReason.WaitingForAllPlayersToBeReady)
{
//?
DebugLog.ToConsole($"Warning - Server waiting for players to die, but players waiting for ready signal! Assume players correct.", MessageType.Warning);
QSBEventManager.FireEvent(EventNames.QSBServerState, ServerState.WaitingForAllPlayersToReady);
}
}
if (CurrentState != State.Loaded)
{
return;