Skip to content

Fix physics double-broadphase update on ent spawning - #7263

Merged
metalgearsloth merged 1 commit into
space-wizards:masterfrom
metalgearsloth:2026-12-02-physics-startup-reinsert
Dec 2, 2026
Merged

metalgearsloth merged 1 commit into
space-wizards:masterfrom
metalgearsloth:2026-12-02-physics-startup-reinsert

Conversation

@metalgearsloth

Copy link
Copy Markdown
Contributor

More free perf yum yum.

More free perf yum yum.
Comment on lines +145 to +147
if (xform.Broadphase is { Valid: true } broadphase &&
broadphase.CanCollide == component.CanCollide &&
broadphase.Static == (component.BodyType == BodyType.Static))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you can't do this check in UpdatePhysicsBroadphase

Also is there any risk of this getting out of sync if SharedContainerSystem, ClientGameStateManager, or any of the other EntityLookupSystem methods change it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't as they all call the physics methods rather than setting it directly (even the physics state handler).

The normal bodytype update path mostly always wants to call it and doesn't need to use the check. With that being said I'd prefer physics init was a bit cleaner but that also ties into #7261 which will mostly definitely break things.

@metalgearsloth
metalgearsloth added this pull request to the merge queue Dec 2, 2026
Merged via the queue into space-wizards:master with commit 09626a3 Dec 2, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants