Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Bugfix net binding destroying random entities #499

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CDufour909
Copy link

When a client is deleting netbound entities (for which he is not the authority), this leaves the NetBinding system with pointers to invalid entities in the m_boundEntities. Causing either crashes or deletion of random entities when the authority actually signals destruction of the netreplicated slice.

To remedy this issue, I'm changingthe m_boundEntities vector contents from Entity pointers to Entity Ids.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

When a client is deleting netbound entities (for which he is not the authority), this leaves the NetBinding system with pointers to invalid entities in the m_boundEntities. Causing either crashes or deletion of random entities when the authority actually signals destruction of the netreplicated slice.

I'm working around this by storing entity Ids rather than storing pointers.
The header file changing the m_boundEntities vector contents from Entity pointers to entity Ids
@AMZN-alexpete
Copy link

Thanks for the fix @CDufour909 ! We're looking over the change and will update this pull request as the status changes.

Fixed bug where whole slice would get destroyed as soon as authority destroyed one of the slice's entities
@CDufour909
Copy link
Author

Hey @AMZN-alexpete,
Been using this code for a couple of days and found a bug where authority deleting a single entity in a slice deleting another entity in the same slice instead. So I just updated the PR to include that fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants