mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix static ent collision spawn (#5933)
* Fix static ent collision spawn * Fix test * cool
This commit is contained in:
@@ -294,6 +294,14 @@ public abstract partial class SharedPhysicsSystem
|
||||
DebugTools.Assert(!fixB.Contacts.ContainsKey(fixA));
|
||||
fixB.Contacts.Add(fixA, contact);
|
||||
bodB.Contacts.AddLast(contact.BodyBNode);
|
||||
|
||||
// If it's a spawned static ent then need to wake any contacting entities.
|
||||
// The issue is that static ents can never be awake and if it spawns on an asleep entity never gets a contact.
|
||||
// Checking only bodyA should be okay because if bodyA is the other ent (i.e. dynamic / kinematic) then it should already be awake.
|
||||
if (bodyA.BodyType == BodyType.Static && !bodyB.Awake)
|
||||
{
|
||||
WakeBody(uidB, body: bodyB);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user