-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(engine/rendering): Fix ChunkMeshRenderer listens to wrong deactivate event #4932
fix(engine/rendering): Fix ChunkMeshRenderer listens to wrong deactivate event #4932
Conversation
looks straightforward. |
@@ -51,7 +51,7 @@ public void onNewMesh(OnActivatedComponent event, EntityRef entity, ChunkMeshCom | |||
disposalSet.add(new BuffersReference(mesh.mesh, disposalQueue)); | |||
} | |||
|
|||
@ReceiveEvent(components = {MeshComponent.class, LocationComponent.class}) | |||
@ReceiveEvent(components = {ChunkMeshComponent.class, LocationComponent.class}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ReceiveEvent(components = {ChunkMeshComponent.class, LocationComponent.class}) | |
@ReceiveEvent(components = {ChunkMeshComponent.class}) |
I think this is better @skaldarnar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EntityBasedRenderableChunk
depends on the existence of a LocationComponent
, meaning psudoChunks
will never contain an entity which doesn't have a LocationComponent
, and that removing it from here would result in reacting to events which don't affect our state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BeforeDeactivateComponent is called when a component is removed from an entity. you would get this hit if either LocationComponent or ChunkMeshComponent is removed. I guess in either case this would be valid behavior? would help to have some unit test verify the behavior. the fix is good as it is at the moment.
Contains
Fixes
ChunkMeshRenderer
reacting to removals ofMeshComponent
instead ofChunkMeshComponent
.