From 3a0662fc80d0dc4a4b257895ec795c0b51787067 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 11 Jul 2021 00:29:02 +0200 Subject: [PATCH 1/5] Fix ladder handling The dialogue callback wasn't being handled due to ann incorrect subscription. This patch resolves --- src/game-engine/world/actor/player/dialogue-action.ts | 3 +-- src/plugins/objects/ladders/ladder.plugin.ts | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/game-engine/world/actor/player/dialogue-action.ts b/src/game-engine/world/actor/player/dialogue-action.ts index 9a25d40d7..cbb981a44 100644 --- a/src/game-engine/world/actor/player/dialogue-action.ts +++ b/src/game-engine/world/actor/player/dialogue-action.ts @@ -140,8 +140,7 @@ export class DialogueAction { this.p.interfaceState.openWidget(widgetId, { slot: 'chatbox' }) - - const sub = this.p.dialogueInteractionEvent.subscribe(action => { + const sub = this.p.interfaceState.closed.subscribe(action => { sub.unsubscribe(); this._action = action; resolve(this); diff --git a/src/plugins/objects/ladders/ladder.plugin.ts b/src/plugins/objects/ladders/ladder.plugin.ts index 60ae576d7..a5b41158c 100644 --- a/src/plugins/objects/ladders/ladder.plugin.ts +++ b/src/plugins/objects/ladders/ladder.plugin.ts @@ -11,7 +11,6 @@ const validate: (level: number) => boolean = (level) => { export const action: objectInteractionActionHandler = (details) => { const { player, option } = details; - if (option === 'climb') { dialogueAction(player) .then(async d => d.options( @@ -22,20 +21,18 @@ export const action: objectInteractionActionHandler = (details) => { ])) .then(d => { d.close(); - switch (d.action) { + switch (d._action.data) { case 1: case 2: - action({ ...details, option: `climb-${(d.action === 1 ? 'up' : 'down')}` }); + action({ ...details, option: `climb-${(d._action.data === 1 ? 'up' : 'down')}` }); return; } }); return; } - const up = option === 'climb-up'; const { position } = player; const level = position.level + (up ? 1 : -1); - if (!validate(level)) return; if (!details.objectConfig.name.startsWith('Stair')) { player.playAnimation(up ? 828 : 827); From 6f94bb1030888902f7e5198167b50309459893fc Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 11 Jul 2021 01:08:01 +0200 Subject: [PATCH 2/5] Add new door ID The barn near the mill has door ID 13001. This commit adds the doo handler for this ID --- src/plugins/objects/doors/door.plugin.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/objects/doors/door.plugin.ts b/src/plugins/objects/doors/door.plugin.ts index cbf3ad3a1..ecba1bb27 100644 --- a/src/plugins/objects/doors/door.plugin.ts +++ b/src/plugins/objects/doors/door.plugin.ts @@ -39,6 +39,11 @@ const doors = [ closed: 11993, open: 11994, hinge: 'RIGHT' + }, + { + closed: 13001, + open: 13002, + hinge: 'RIGHT' } ]; @@ -98,7 +103,7 @@ export default { { type: 'object_interaction', objectIds: [ 1530, 4465, 4467, 3014, 3017, 3018, - 3019, 1536, 1537, 1533, 1531, 1534, 12348, 11993, 11994 ], + 3019, 1536, 1537, 1533, 1531, 1534, 12348, 11993, 11994, 13001, 13002 ], options: [ 'open', 'close' ], walkTo: true, handler: action From efd6aec06395284d28fb2b3f2acb4080b0126fe7 Mon Sep 17 00:00:00 2001 From: Ryan Pannell Date: Sun, 11 Jul 2021 01:52:22 +0200 Subject: [PATCH 3/5] Fix linting --- src/plugins/objects/doors/door.plugin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/objects/doors/door.plugin.ts b/src/plugins/objects/doors/door.plugin.ts index ecba1bb27..5c9f3fac3 100644 --- a/src/plugins/objects/doors/door.plugin.ts +++ b/src/plugins/objects/doors/door.plugin.ts @@ -41,9 +41,9 @@ const doors = [ hinge: 'RIGHT' }, { - closed: 13001, - open: 13002, - hinge: 'RIGHT' + closed: 13001, + open: 13002, + hinge: 'RIGHT' } ]; From 5c01491556e690754d7cac4cf65fd70c5f9e0d01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Aug 2021 18:09:30 +0000 Subject: [PATCH 4/5] Bump tar from 4.4.13 to 4.4.15 Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-tar/compare/v4.4.13...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91c7f58fe..e9abae5fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6202,9 +6202,9 @@ } }, "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "version": "4.4.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.15.tgz", + "integrity": "sha512-ItbufpujXkry7bHH9NpQyTXPbJ72iTlXgkBAYsAjDXk3Ds8t/3NfO5P4xZGy7u+sYuQUbimgzswX4uQIEeNVOA==", "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", From 38ad9123b6da071b8b57dc55da9c65c28048deab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Schauwers?= Date: Sun, 8 Aug 2021 18:48:08 +0200 Subject: [PATCH 5/5] Fixed issue where the server would crash when withdrawing multiple items --- src/plugins/objects/bank/bank.plugin.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/objects/bank/bank.plugin.ts b/src/plugins/objects/bank/bank.plugin.ts index 2afc96771..34432164c 100644 --- a/src/plugins/objects/bank/bank.plugin.ts +++ b/src/plugins/objects/bank/bank.plugin.ts @@ -170,9 +170,7 @@ export const withdrawItem: itemInteractionActionHandler = (details) => { amount: removeFromContainer(playerBank, details.itemId, countToRemove) }; - for (let i = 0; i < itemToAdd.amount; i++) { - playerInventory.add({ itemId: itemIdToAdd, amount: 1 }); - } + playerInventory.add({ itemId: itemToAdd.itemId, amount: itemToAdd.amount }); updateBankingInterface(details.player); };