Skip to content

Commit

Permalink
Merge pull request #35 from justindujardin/fix/swap-equipment
Browse files Browse the repository at this point in the history
fix(inventory): allow swapping equipment without unequipping first
  • Loading branch information
justindujardin authored Oct 27, 2022
2 parents d035ffd + 73dd417 commit ed79dc7
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 ed79dc7

Please sign in to comment.