Skip to content

Commit 759c818

Browse files
committed
linting!
1 parent a5b690f commit 759c818

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/plugins/objects/bank/bank-booth-plugin.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { ActionType, RunePlugin } from '@server/plugins/plugin';
22
import { objectIds } from '@server/world/config/object-ids';
33
import { widgets } from '@server/world/config/widget';
44
import { objectAction } from '@server/world/actor/player/action/object-action';
5-
import { ItemContainer } from "@server/world/items/item-container";
6-
import { itemAction } from "@server/world/actor/player/action/item-action";
7-
import { Item } from "@server/world/items/item";
5+
import { ItemContainer } from '@server/world/items/item-container';
6+
import { itemAction } from '@server/world/actor/player/action/item-action';
7+
import { Item } from '@server/world/items/item';
88

99

1010
export const openBankInterface: objectAction = (details) => {
@@ -35,10 +35,10 @@ export const depositItem: itemAction = (details) => {
3535
}
3636

3737
let countToRemove: number;
38-
if (details.option.endsWith("all")) {
38+
if (details.option.endsWith('all')) {
3939
countToRemove = -1;
4040
} else {
41-
countToRemove = +details.option.replace("deposit-", "");
41+
countToRemove = +details.option.replace('deposit-', '');
4242
}
4343

4444
const playerInventory: ItemContainer = details.player.inventory;
@@ -47,16 +47,16 @@ export const depositItem: itemAction = (details) => {
4747
let itemAmount: number = 0;
4848
slotsWithItem.forEach((slot) => itemAmount += playerInventory.items[slot].amount);
4949
if (countToRemove == -1 || countToRemove > itemAmount) {
50-
countToRemove = itemAmount
50+
countToRemove = itemAmount;
5151
}
5252

5353
if (!playerBank.canFit({itemId: details.itemId, amount: countToRemove}, true)) {
54-
details.player.sendMessage("Your bank is full.");
54+
details.player.sendMessage('Your bank is full.');
5555
return;
5656
}
5757

5858

59-
const itemToAdd: Item = {itemId: details.itemId, amount: 0}
59+
const itemToAdd: Item = {itemId: details.itemId, amount: 0};
6060
while (countToRemove > 0 && playerInventory.has(details.itemId)) {
6161
const invIndex = playerInventory.findIndex(details.itemId);
6262
const invItem = playerInventory.items[invIndex];
@@ -91,18 +91,18 @@ export const withdrawItem: itemAction = (details) => {
9191
return;
9292
}
9393
let countToRemove: number;
94-
if (details.option.endsWith("all")) {
94+
if (details.option.endsWith('all')) {
9595
countToRemove = -1;
9696
} else {
97-
countToRemove = +details.option.replace("withdraw-", "");
97+
countToRemove = +details.option.replace('withdraw-', '');
9898
}
9999

100100
const playerBank: ItemContainer = details.player.bank;
101101
const playerInventory: ItemContainer = details.player.inventory;
102102
const slotWithItem: number = playerBank.findIndex(details.itemId);
103-
let itemAmount: number = playerBank.items[slotWithItem].amount;
103+
const itemAmount: number = playerBank.items[slotWithItem].amount;
104104
if (countToRemove == -1 || countToRemove > itemAmount) {
105-
countToRemove = itemAmount
105+
countToRemove = itemAmount;
106106
}
107107

108108
if (!details.itemDetails.stackable) {
@@ -113,12 +113,12 @@ export const withdrawItem: itemAction = (details) => {
113113
}
114114

115115
if (!playerInventory.canFit({itemId: details.itemId, amount: countToRemove})) {
116-
details.player.sendMessage("Your inventory is full.");
116+
details.player.sendMessage('Your inventory is full.');
117117
return;
118118
}
119119

120120

121-
const itemToAdd: Item = {itemId: details.itemId, amount: 0}
121+
const itemToAdd: Item = {itemId: details.itemId, amount: 0};
122122
while (countToRemove > 0 && playerBank.has(details.itemId)) {
123123
const invIndex = playerBank.findIndex(details.itemId);
124124
const invItem = playerBank.items[invIndex];
@@ -129,7 +129,7 @@ export const withdrawItem: itemAction = (details) => {
129129
} else {
130130
itemToAdd.amount += countToRemove;
131131
invItem.amount -= countToRemove;
132-
countToRemove = 0
132+
countToRemove = 0;
133133
}
134134
}
135135
playerInventory.addStacking(itemToAdd);

src/world/actor/player/player-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function savePlayerData(player: Player): boolean {
124124
appearance: player.appearance,
125125
inventory: player.inventory.items,
126126
bank: player.bank.items.filter((item) => {
127-
return item !== null
127+
return !!item;
128128
}),
129129
equipment: player.equipment.items,
130130
skills: player.skills.values,

src/world/config/harvestable-object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { objectIds } from "@server/world/config/object-ids";
1+
import { objectIds } from '@server/world/config/object-ids';
22

33
export interface IHarvestable {
44
objects: Map<number, number>;

src/world/config/widget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const widgets: any = {
3333
bank: {
3434
screenWidget: {
3535
widgetId: 12,
36-
containerId:89,
36+
containerId: 89,
3737
},
3838
tabWidget: {
3939
widgetId: 266,

0 commit comments

Comments
 (0)