mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Don't reset sleeptimer on building physics islands
This commit is contained in:
@@ -136,6 +136,17 @@ namespace Robust.Shared.GameObjects
|
||||
[DataField("bodyType")]
|
||||
private BodyType _bodyType = BodyType.Static;
|
||||
|
||||
/// <summary>
|
||||
/// Set awake without the sleeptimer being reset.
|
||||
/// </summary>
|
||||
internal void ForceAwake()
|
||||
{
|
||||
if (_awake || _bodyType == BodyType.Static) return;
|
||||
|
||||
_awake = true;
|
||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new PhysicsWakeMessage(this));
|
||||
}
|
||||
|
||||
// We'll also block Static bodies from ever being awake given they don't need to move.
|
||||
/// <inheritdoc />
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -538,7 +538,7 @@ namespace Robust.Shared.Physics.Dynamics
|
||||
if (body.BodyType == BodyType.Static) continue;
|
||||
|
||||
// As static bodies can never be awake (unlike Farseer) we'll set this after the check.
|
||||
body.Awake = true;
|
||||
body.ForceAwake();
|
||||
|
||||
for (var contactEdge = body.ContactEdges; contactEdge != null; contactEdge = contactEdge.Next)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user