fix: no switching

This commit is contained in:
cha0s 2021-04-20 06:54:53 -05:00
parent 46081203eb
commit 6def1588e0

View File

@ -44,6 +44,9 @@ export default () => class Wielder extends decorate(Trait) {
acceptAction: ({action, value}) => { acceptAction: ({action, value}) => {
const hotbarMatch = action.match(/^HotbarSlot(\d)/); const hotbarMatch = action.match(/^HotbarSlot(\d)/);
if (hotbarMatch && !this.entity.isAcceptingInput) {
return undefined;
}
if (hotbarMatch && value) { if (hotbarMatch && value) {
this.entity.activeSlotIndex = (parseInt(hotbarMatch[1], 10) + 10) % 10; this.entity.activeSlotIndex = (parseInt(hotbarMatch[1], 10) + 10) % 10;
return undefined; return undefined;