(99e6eb7c7) Fixed "attempted to access a potentially removed ragdoll" in SoundPlayer.Update, set Character.Controlled to null if the character is removed to prevent this from happening elsewhere
This commit is contained in:
@@ -46,8 +46,7 @@ namespace Barotrauma
|
||||
if (controlled == value) return;
|
||||
controlled = value;
|
||||
if (controlled != null) controlled.Enabled = true;
|
||||
CharacterHealth.OpenHealthWindow = null;
|
||||
|
||||
CharacterHealth.OpenHealthWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
float ambienceVolume = 0.8f;
|
||||
if (Character.Controlled != null)
|
||||
if (Character.Controlled != null && !Character.Controlled.Removed)
|
||||
{
|
||||
AnimController animController = Character.Controlled.AnimController;
|
||||
if (animController.HeadInWater)
|
||||
|
||||
Reference in New Issue
Block a user