Fix BUGZ-1197 (and others): Ensure enterEntity is emitted when avatar is inside entity and script is reloaded

This commit is contained in:
Zach Fox 2019-08-07 13:55:16 -04:00
parent ba7f9f410b
commit b45e670d21

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) {