Reapply "OBT1.1.0 Merge branch 'dev_pte' into dev"
This reverts commit 046483b9da.
This commit is contained in:
@@ -890,7 +890,8 @@ namespace Barotrauma.Items.Components
|
||||
RelatedItem containableItem = FindContainableItem(containedItem);
|
||||
if (containableItem != null && containableItem.SetActive)
|
||||
{
|
||||
foreach (var ic in containedItem.Components)
|
||||
// Use ToArray() snapshot for thread-safe iteration
|
||||
foreach (var ic in containedItem.Components.ToArray())
|
||||
{
|
||||
ic.IsActive = active;
|
||||
}
|
||||
@@ -1016,7 +1017,11 @@ namespace Barotrauma.Items.Components
|
||||
if (flippedX ^ flippedY) { rotation = -rotation; }
|
||||
rotation += -item.RotationRad;
|
||||
}
|
||||
contained.Item.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, rotation);
|
||||
// Defer physics operation if in parallel context (Farseer is not thread-safe)
|
||||
var capturedBody = contained.Item.body.FarseerBody;
|
||||
var capturedSimPos = simPos;
|
||||
var capturedRotation = rotation;
|
||||
PhysicsBodyQueue.ExecuteOrDefer(() => capturedBody.SetTransformIgnoreContacts(ref capturedSimPos, capturedRotation));
|
||||
contained.Item.body.UpdateDrawPosition(interpolate: false);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user