Closed brenodt closed 2 years ago
How sloppy, we had this issue some time ago with contacts
, which are removed right below the joints
.
We could do the same quick fix there.
https://github.com/flame-engine/forge2d/blob/main/lib/src/dynamics/world.dart#L149-L153
Could you try depending on the branch in the PR @brenodt to confirm that it is solved?
@spydon I can confirm it fixes the issue. Thanks!
Hey, I was wondering if there's any estimation to when this will be merged. As my project depends on flame_forge2d
I can't make use of the branch while it's not released.
You can make use of it with dependency_overrides
:
dependency_overrides:
flame:
git:
url: https://github.com/flame-engine/forge2d.git
ref: main
If you want to speed up the process a bit you can just write a simple test for the fix that I did and push up a PR and I can do a release tonight.
Added a test for the fix and released 0.8.2
I'm using Flame & Forge2d draw some components based on the state of my application. There's also the option to filter such state to display only a certain type of data, which in turn means the
Forge2DGame
rebuilds to reflect the new data source.In my simulation, I have the components drawn into a tree-like structure, where children are tied to their parent through a
Joint
. Whenever my game gets rebuilt (and, in the process, destroyed) I get the following exception:The following ConcurrentModificationError was thrown building _BodyBuilder: Concurrent modification during iteration: Instance(length:2) of '_GrowableList'.
It seems that the culprit is
forge2d/lib/src/dynamics/world.dart:144
:Maybe something in the line of this would work to fix it?
Here's a minimal reproducible example:
Full Stacktrace
Thanks for the great package! Let me know if any further info is needed.