OBT/1.0.13

Fixed another crash(Object reference not set to an instance of an object.)
This commit is contained in:
NotAlwaysTrue
2026-01-02 18:34:12 +08:00
committed by GitHub
parent 59da9211f6
commit f3c22315a1

View File

@@ -1184,6 +1184,10 @@ namespace Barotrauma
public void Teleport(Vector2 moveAmount, Vector2 velocityChange, bool detachProjectiles = true)
{
// Hopefully this will fix some crashes :(
// If Collider was null then no need to procced: nothing is there already
if (Collider == null) { return; }
foreach (Limb limb in Limbs)
{
if (limb.IsSevered) { continue; }
@@ -1205,6 +1209,7 @@ namespace Barotrauma
character.DisableImpactDamageTimer = 0.25f;
// Why they did null check below but didn't do it here????
SetPosition(Collider.SimPosition + moveAmount);
character.CursorPosition += moveAmount;