diff --git a/client/src/scenes/item.list.js b/client/src/scenes/item.list.js index 511a9ef6..4742f7a0 100644 --- a/client/src/scenes/item.list.js +++ b/client/src/scenes/item.list.js @@ -269,11 +269,13 @@ class ItemList extends Phaser.Scene { // hitbox can only be the combinerhitbox, deletehitbox or cryp avatar hitBox.itemDeselect(); if (hitBox instanceof CombinerHitBox) { - allocate(item, hitBox); + if (hitBox.item === item) deallocate(item); + else allocate(item, hitBox); } else if (hitBox instanceof DeleteHitBox) { ws.sendVboxDrop(vbox.instance, item.index); } else { ws.sendVboxApply(vbox.instance, hitBox.cryp.id, item.index); + deallocate(item); } return true; } // If not interacting with hitbox and didn't move much try to allocate the item diff --git a/client/src/scenes/menu.js b/client/src/scenes/menu.js index 48644f19..4f4b397d 100644 --- a/client/src/scenes/menu.js +++ b/client/src/scenes/menu.js @@ -36,12 +36,15 @@ class Menu extends Phaser.Scene { // When we load the menu request the latest items // Item list will restart when the data comes in - this.scene.manager.add('MenuCrypList', MenuCrypList, true); this.scene.manager.add('MenuNavigation', MenuNavigation, true); this.scene.manager.add('MenuScore', MenuScore, true); this.scene.manager.add('ItemList', ItemList, true); this.registry.set('inMenu', true); + + // Request the latest player state when we load the scene + const { instance } = this.registry.get('player'); + this.registry.get('ws').sendPlayerState(instance); return true; }