Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Fix IsEntity sometimes returning true for previously deleted entities #508

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Hammie
Copy link
Member

@Hammie Hammie commented Sep 24, 2023

When deleting an entity, saving the game and then loading that save game, it is possible for a newly created entity to have the same id as the old deleted entity id.

If the old entity variable is not yet overwritten, it will then return true for IsEntity(&entity).

This can be fixed by making sure the variable value is reset after calling DeleteEntity

Also fixes PiratesAhoy/new-horizons#141

@espkk
Copy link
Member

espkk commented Oct 14, 2023

While it helps in some cases it's not the root cause and has to be fixed differently...
So, we probably don't want to merge this. Instead, we shouldn't zero the cookie counter during entity manager's full-erase

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

Successfully merging this pull request may close these issues.

Controls not working when loading sea view
3 participants