Skip to content
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

Bug in ECS::removeEntity #7

Open
ScottAlexanderCameron opened this issue Feb 18, 2019 · 0 comments
Open

Bug in ECS::removeEntity #7

ScottAlexanderCameron opened this issue Feb 18, 2019 · 0 comments

Comments

@ScottAlexanderCameron
Copy link

Line 49 of ecs.cpp moves the last entity pointer of the array to the index where the entity being removed currently is. The first element of the pair representing the entity is supposed to be the index in the array where that entity lives. The entity moved on this line now lives at index destIndex, while the first element of the pair is still srcIndex. Perhaps after the move, there should also be the following assignment:

entities[destIndex]->first = destIndex;
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

No branches or pull requests

1 participant