fix(studio): self.delete снимает interact-подсказку (E больше не висит на пустоте)

_applySelfDelete удалял меш, но запись в _interactables оставалась → промпт
«E Собрать» висел на месте собранного предмета. Теперь запись чистится по ref.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
min 2026-06-07 14:59:25 +03:00
parent c62073f7f8
commit e15dc56de3

View File

@ -4314,6 +4314,11 @@ export class GameRuntime {
const id = t.id ?? t.ref; const id = t.id ?? t.ref;
this.scene3d?.primitiveManager?.removeInstance(id); this.scene3d?.primitiveManager?.removeInstance(id);
} }
// Снять interact-подсказку удалённого объекта (иначе «E» висит на пустоте).
if (t.kind && (t.ref ?? t.id) != null && Array.isArray(this._interactables)) {
const ref = t.kind + ':' + (t.ref ?? t.id);
this._interactables = this._interactables.filter(it => it.ref !== ref);
}
this.scheduleSceneSnapshot(); this.scheduleSceneSnapshot();
} catch (e) { } catch (e) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console