mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-17 04:21:02 +00:00
fix ship
This commit is contained in:
parent
126a4636fc
commit
2935d77ef5
@ -1,4 +1,5 @@
|
||||
using QSB.Player;
|
||||
using OWML.Common;
|
||||
using QSB.Player;
|
||||
using QSB.SectorSync;
|
||||
using QSB.SectorSync.WorldObjects;
|
||||
using QSB.Utility;
|
||||
@ -97,7 +98,7 @@ namespace QSB.Syncs.Sectored
|
||||
{
|
||||
if (sector == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - {PlayerId}.{GetType().Name} got sector of ID -1.", OWML.Common.MessageType.Error);
|
||||
DebugLog.ToConsole($"Error - {LogName} got sector of ID -1. (From waiting slot.)", OWML.Common.MessageType.Error);
|
||||
base.Update();
|
||||
return;
|
||||
}
|
||||
@ -112,15 +113,21 @@ namespace QSB.Syncs.Sectored
|
||||
|
||||
public override void SerializeTransform(QNetworkWriter writer, bool initialState)
|
||||
{
|
||||
if (!QSBPlayerManager.PlayerExists(PlayerId))
|
||||
if (IsPlayerObject)
|
||||
{
|
||||
writer.Write(-1);
|
||||
if (!QSBPlayerManager.PlayerExists(PlayerId))
|
||||
{
|
||||
writer.Write(-1);
|
||||
return;
|
||||
}
|
||||
else if (!Player.IsReady)
|
||||
{
|
||||
writer.Write(-1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!Player.IsReady)
|
||||
{
|
||||
writer.Write(-1);
|
||||
}
|
||||
else if (ReferenceSector != null)
|
||||
|
||||
if (ReferenceSector != null)
|
||||
{
|
||||
writer.Write(ReferenceSector.ObjectId);
|
||||
}
|
||||
@ -128,7 +135,7 @@ namespace QSB.Syncs.Sectored
|
||||
{
|
||||
if (_isInitialized)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - ReferenceSector of {PlayerId}.{GetType().Name} is null.", OWML.Common.MessageType.Warning);
|
||||
DebugLog.ToConsole($"Warning - ReferenceSector of {LogName} is null.", MessageType.Warning);
|
||||
}
|
||||
|
||||
writer.Write(-1);
|
||||
@ -159,7 +166,7 @@ namespace QSB.Syncs.Sectored
|
||||
{
|
||||
if (sector == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - {PlayerId}.{GetType().Name} got sector of ID -1.", OWML.Common.MessageType.Error);
|
||||
DebugLog.ToConsole($"Error - {LogName} got sector of ID -1. (From deserializing transform.)", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -202,7 +209,7 @@ namespace QSB.Syncs.Sectored
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugLog.ToConsole($"Error - No closest sector found to {PlayerId}.{GetType().Name}!", OWML.Common.MessageType.Error);
|
||||
DebugLog.ToConsole($"Error - No closest sector found to {LogName}!", OWML.Common.MessageType.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user