Merge pull request #16039 from zfox23/enterEntityOnReload

Fix BUGZ-1197 (and others): Ensure enterEntity is emitted when avatar is inside entity and script is reloaded
This commit is contained in:
Brad Hefta-Gaub 2019-08-07 11:49:44 -07:00 committed by GitHub
commit 9702fb48b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1027,6 +1027,10 @@ void EntityTreeRenderer::addingEntity(const EntityItemID& entityID) {
void EntityTreeRenderer::entityScriptChanging(const EntityItemID& entityID, bool reload) {
checkAndCallPreload(entityID, reload, true);
// Force "re-checking" entities so that the logic inside `checkEnterLeaveEntities()` is run.
// This will ensure that the `enterEntity()` signal is emitted on clients whose avatars
// are inside an entity when the script is reloaded.
forceRecheckEntities();
}
void EntityTreeRenderer::checkAndCallPreload(const EntityItemID& entityID, bool reload, bool unloadFirst) {