marker bug

This commit is contained in:
Aleksander Waage 2020-08-23 19:17:15 +02:00
parent e0c1126f2a
commit d22fb21479
2 changed files with 6 additions and 15 deletions

View File

@ -132,9 +132,7 @@ namespace QSB.DeathSync
{ {
return _playerSpawner return _playerSpawner
.GetValue<SpawnPoint[]>("_spawnList") .GetValue<SpawnPoint[]>("_spawnList")
.FirstOrDefault(spawnPoint => .FirstOrDefault(spawnPoint => spawnPoint.GetSpawnLocation() == SpawnLocation.TimberHearth && spawnPoint.IsShipSpawn() == isShip);
spawnPoint.GetSpawnLocation() == SpawnLocation.TimberHearth && spawnPoint.IsShipSpawn() == isShip
);
} }
} }
} }

View File

@ -1,7 +1,4 @@
using OWML.Common; using UnityEngine;
using QSB.Utility;
using System;
using UnityEngine;
namespace QSB.TransformSync namespace QSB.TransformSync
{ {
@ -50,17 +47,13 @@ namespace QSB.TransformSync
public void Remove() public void Remove()
{ {
// do N O T destroy the parent - it completely breaks the ENTIRE GAME // do N O T destroy the parent - it completely breaks the ENTIRE GAME
try if (_canvasMarker.gameObject != null)
{ {
_canvasMarker.DestroyMarker(); _canvasMarker.DestroyMarker();
Destroy(_markerTarget.gameObject);
Destroy(this);
} }
catch (Exception ex) Destroy(_markerTarget.gameObject);
{ Destroy(this);
DebugLog.ToConsole($"Warning - Failed to remove PlayerHUDMarker for {_player.Name} ({_player.NetId}) : {ex}", MessageType.Warning);
}
} }
} }
} }