mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
fix some errors
This commit is contained in:
parent
7d6aa70d6e
commit
1824a5481c
@ -125,10 +125,16 @@ namespace QSB.DeathSync
|
||||
}
|
||||
|
||||
private SpawnPoint GetSpawnPoint(bool isShip = false)
|
||||
=> _playerSpawner
|
||||
.GetValue<SpawnPoint[]>("_spawnList")
|
||||
.FirstOrDefault(spawnPoint =>
|
||||
{
|
||||
var spawnList = _playerSpawner.GetValue<SpawnPoint[]>("_spawnList");
|
||||
if (spawnList == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - _spawnList was null for player spawner!", MessageType.Warning);
|
||||
return null;
|
||||
}
|
||||
return spawnList.FirstOrDefault(spawnPoint =>
|
||||
spawnPoint.GetSpawnLocation() == SpawnLocation.TimberHearth
|
||||
&& spawnPoint.IsShipSpawn() == isShip);
|
||||
}
|
||||
}
|
||||
}
|
@ -146,10 +146,13 @@ namespace QSB
|
||||
}
|
||||
|
||||
var offset3 = 10f;
|
||||
GUI.Label(new Rect(420, offset3, 200f, 20f), $"Current closest sector :");
|
||||
GUI.Label(new Rect(420, offset3, 200f, 20f), $"Current synced sector :");
|
||||
offset3 += _debugLineSpacing;
|
||||
var sector = PlayerTransformSync.LocalInstance.SectorSync.GetClosestSector(Locator.GetPlayerTransform());
|
||||
GUI.Label(new Rect(420, offset3, 400f, 20f), $"- {sector.AttachedObject.name} : {sector.IsFakeSector}");
|
||||
var sector = PlayerTransformSync.LocalInstance.ReferenceSector;
|
||||
var text = sector == null
|
||||
? "NULL SECTOR"
|
||||
: $"{sector.AttachedObject.name} : {sector.IsFakeSector}";
|
||||
GUI.Label(new Rect(420, offset3, 400f, 20f), $"- {text}");
|
||||
offset3 += _debugLineSpacing;
|
||||
|
||||
var offset2 = 10f;
|
||||
|
@ -92,9 +92,7 @@ namespace QSB.SectorSync
|
||||
&& sector.ShouldSyncTo());
|
||||
if (activeNotNullNotBlacklisted.Count() == 0)
|
||||
{
|
||||
DebugLog.ToConsole(
|
||||
$"Error - Zero available sectors for {trans.name} to sync to! Current QSBSector count : {QSBWorldSync.GetWorldObjects<QSBSector>().Count()}",
|
||||
MessageType.Error);
|
||||
return default;
|
||||
}
|
||||
var ordered = activeNotNullNotBlacklisted
|
||||
.OrderBy(sector => Vector3.Distance(sector.Position, trans.position))
|
||||
|
@ -34,16 +34,17 @@ namespace QSB.SectorSync.WorldObjects
|
||||
|
||||
public bool ShouldSyncTo()
|
||||
{
|
||||
if (!AttachedObject.gameObject.activeInHierarchy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (AttachedObject == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - AttachedObject for sector id:{ObjectId} is null!", MessageType.Warning);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!AttachedObject.gameObject.activeInHierarchy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Type == Sector.Name.Ship)
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user