Skip to content

Commit

Permalink
Merge branch 'runejs:develop' into no-zero-items
Browse files Browse the repository at this point in the history
  • Loading branch information
src52 authored Aug 10, 2021
2 parents 0149cef + b465995 commit e59385d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/game-engine/world/actor/player/dialogue-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/objects/bank/bank.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
7 changes: 6 additions & 1 deletion src/plugins/objects/doors/door.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ const doors = [
closed: 11993,
open: 11994,
hinge: 'RIGHT'
},
{
closed: 13001,
open: 13002,
hinge: 'RIGHT'
}
];

Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/plugins/objects/ladders/ladder.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand Down

0 comments on commit e59385d

Please sign in to comment.