mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
fix nre in DisplayLines
This commit is contained in:
parent
086a129bad
commit
0e9f85ee9b
@ -205,20 +205,53 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
|
||||
public override void DisplayLines()
|
||||
{
|
||||
if (AttachedObject == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var localPlayer = QSBPlayerManager.LocalPlayer;
|
||||
|
||||
if (localPlayer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var body = localPlayer.Body;
|
||||
|
||||
if (body == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ControllingPlayer == 0)
|
||||
{
|
||||
if (IsEnabled)
|
||||
{
|
||||
Popcron.Gizmos.Line(AttachedObject.transform.position,
|
||||
QSBPlayerManager.LocalPlayer.Body.transform.position,
|
||||
body.transform.position,
|
||||
Color.magenta * 0.25f);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(ControllingPlayer);
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var playerBody = player.Body;
|
||||
|
||||
if (playerBody == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Popcron.Gizmos.Line(AttachedObject.transform.position,
|
||||
QSBPlayerManager.GetPlayer(ControllingPlayer).Body.transform.position,
|
||||
playerBody.transform.position,
|
||||
Color.magenta);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user