refactor: app doesn't manage held item

This commit is contained in:
cha0s 2019-05-27 22:17:25 -05:00
parent faa2406039
commit 1d7e1cc1ee

View File

@ -357,17 +357,6 @@ export class App extends decorate(class {}) {
this.stage.camera = camera; this.stage.camera = camera;
// Avoid the initial 'lerp. // Avoid the initial 'lerp.
camera.realPosition = camera.position; camera.realPosition = camera.position;
// Manage held item.
entity.on('activeSlotIndexChanged', (oldIndex, newIndex) => {
const oldItem = entity.itemInSlot(oldIndex);
if (oldItem) {
oldItem.wielder = null;
}
const newItem = entity.itemInSlot(newIndex);
if (newItem) {
newItem.wielder = entity;
}
});
} }
} }
} }