Null reference fixes
This commit is contained in:
@@ -1294,7 +1294,7 @@ namespace Barotrauma
|
|||||||
(c2.IsRemotePlayer || c2 == GameMain.Server.Character) &&
|
(c2.IsRemotePlayer || c2 == GameMain.Server.Character) &&
|
||||||
Vector2.Distance(c2.WorldPosition, c.WorldPosition) < NetConfig.CharacterIgnoreDistance);
|
Vector2.Distance(c2.WorldPosition, c.WorldPosition) < NetConfig.CharacterIgnoreDistance);
|
||||||
}
|
}
|
||||||
else
|
else if (Submarine.MainSub != null)
|
||||||
{
|
{
|
||||||
//disable AI characters that are far away from the sub and the controlled character
|
//disable AI characters that are far away from the sub and the controlled character
|
||||||
c.Enabled = Vector2.Distance(Submarine.MainSub.WorldPosition, c.WorldPosition) < NetConfig.CharacterIgnoreDistance ||
|
c.Enabled = Vector2.Distance(Submarine.MainSub.WorldPosition, c.WorldPosition) < NetConfig.CharacterIgnoreDistance ||
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
item.ApplyStatusEffects(ActionType.OnFire, 1.0f);
|
item.ApplyStatusEffects(ActionType.OnFire, 1.0f);
|
||||||
|
|
||||||
if (item.Condition <= 0.0f)
|
if (item.Condition <= 0.0f && GameMain.Server != null)
|
||||||
{
|
{
|
||||||
GameMain.Server.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ApplyStatusEffect, ActionType.OnFire });
|
GameMain.Server.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ApplyStatusEffect, ActionType.OnFire });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ namespace Barotrauma
|
|||||||
if (item.Position.Y < position.Y - size.Y || item.Position.Y > hull.Rect.Y) continue;
|
if (item.Position.Y < position.Y - size.Y || item.Position.Y > hull.Rect.Y) continue;
|
||||||
|
|
||||||
item.ApplyStatusEffects(ActionType.OnFire, deltaTime);
|
item.ApplyStatusEffects(ActionType.OnFire, deltaTime);
|
||||||
if (item.Condition <= 0.0f)
|
if (item.Condition <= 0.0f && GameMain.Server != null)
|
||||||
{
|
{
|
||||||
GameMain.Server.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ApplyStatusEffect, ActionType.OnFire });
|
GameMain.Server.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ApplyStatusEffect, ActionType.OnFire });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ namespace Barotrauma
|
|||||||
item.Update(cam, deltaTime);
|
item.Update(cam, deltaTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity.Spawner.Update();
|
Spawner?.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Update(Camera cam, float deltaTime) { }
|
public virtual void Update(Camera cam, float deltaTime) { }
|
||||||
|
|||||||
Reference in New Issue
Block a user