Skip to content

Commit

Permalink
fix(inventory): allow swapping equipment without unequipping first
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Oct 27, 2022
1 parent d035ffd commit 73dd417
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,14 @@ export class PartyInventoryComponent implements OnDestroy {
return this.notify.show(`${entity.name} cannot equip this item`);
}
if (entity[event.slot]) {
return this.notify.show(`${entity.name} already has item in ${event.slot}`);
const oldItem: any = entity[event.slot];
this.store.dispatch(
new GameStateUnequipItemAction({
entityId: entity.eid,
slot: event.slot,
itemId: oldItem.eid,
})
);
}
this.store.dispatch(
new GameStateEquipItemAction({
Expand Down

0 comments on commit 73dd417

Please sign in to comment.