Skip to content

Commit 7c188d4

Browse files
Fix island propagation
Accidentally swapped out the propagation part of the floodfill algorithm with a loop, fixed
1 parent c4e9a41 commit 7c188d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Robust.Shared/Physics/Systems/SharedPhysicsSystem.Island.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -378,17 +378,17 @@ private void Solve(EntityUid uid, PhysicsMapComponent component, float frameTime
378378

379379
contacts.Add(contact);
380380
contact.Flags |= ContactFlags.Island;
381-
var bodyA = contact.BodyA!;
382-
var bodyB = contact.BodyB!;
381+
var bodyA = new Entity<PhysicsComponent>(contact.EntityA, contact.BodyA!);
382+
var bodyB = new Entity<PhysicsComponent>(contact.EntityB, contact.BodyB!);
383383

384-
var other = bodyA == body ? bodyB : bodyA;
384+
var other = bodyA.Comp == body ? bodyB : bodyA;
385385

386386
// Was the other body already added to this island?
387-
if (other.Island)
387+
if (other.Comp.Island)
388388
continue;
389389

390-
_bodyStack.Push(bodyEnt);
391-
other.Island = true;
390+
_bodyStack.Push(other);
391+
other.Comp.Island = true;
392392
}
393393

394394
// Handle joints

0 commit comments

Comments
 (0)