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

Fix invalidated linked entities in node graph #106

Merged
merged 3 commits into from
Dec 4, 2021

Conversation

zpl-zak
Copy link
Contributor

@zpl-zak zpl-zak commented Dec 3, 2021

Originally, Precache() would attempt to renew all linked entity pointers based on their stored model name, however since not all entities are initialized from a saved game during this stage yet, occasionally, the game would fail to renew linked ent pointers and therefore lose reference to doors (etc) that block a traversal path between nodes.

The change should ensure we relink referenced entity pointers at a time when all entities are already present, therefore we ensure references are still resolved correctly and the pathfinding continues to work correctly even after we load a saved game.

Previous behavior:
NPC would fail to navigate through doors on a loaded save.

Current behavior:
NPC has no issue navigating through doors on a loaded save.

Originally, Precache() would attempt to renew all linked entity pointers based on their stored model name, however since not all entities are initialized from a saved game during this stage yet, occasionally, the game would fail to renew linked ent pointers and therefore lose reference to doors (etc) that block a traversal path between nodes.

The change should ensure we relink referenced entity pointers at a time when all entities are already present, therefore we ensure references are still resolved correctly and the pathfinding continues to work correctly even after we load a saved game.

Previous behavior:
NPC would fail to navigate through doors on a loaded save.

Current behavior:
NPC has no issue navigating through doors on a loaded save.
Admittedly, UpdateClientData() is unsuitable place for the logic, PreThink is where it should have been placed.
@SamVanheer SamVanheer merged commit a7cbbbe into twhl-community:master Dec 4, 2021
@zpl-zak zpl-zak deleted the patch-1 branch December 10, 2021 18:27
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

Successfully merging this pull request may close these issues.

2 participants