@@ -2,9 +2,9 @@ import { ActionType, RunePlugin } from '@server/plugins/plugin';
2
2
import { objectIds } from '@server/world/config/object-ids' ;
3
3
import { widgets } from '@server/world/config/widget' ;
4
4
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' ;
8
8
9
9
10
10
export const openBankInterface : objectAction = ( details ) => {
@@ -35,10 +35,10 @@ export const depositItem: itemAction = (details) => {
35
35
}
36
36
37
37
let countToRemove : number ;
38
- if ( details . option . endsWith ( " all" ) ) {
38
+ if ( details . option . endsWith ( ' all' ) ) {
39
39
countToRemove = - 1 ;
40
40
} else {
41
- countToRemove = + details . option . replace ( " deposit-" , "" ) ;
41
+ countToRemove = + details . option . replace ( ' deposit-' , '' ) ;
42
42
}
43
43
44
44
const playerInventory : ItemContainer = details . player . inventory ;
@@ -47,16 +47,16 @@ export const depositItem: itemAction = (details) => {
47
47
let itemAmount : number = 0 ;
48
48
slotsWithItem . forEach ( ( slot ) => itemAmount += playerInventory . items [ slot ] . amount ) ;
49
49
if ( countToRemove == - 1 || countToRemove > itemAmount ) {
50
- countToRemove = itemAmount
50
+ countToRemove = itemAmount ;
51
51
}
52
52
53
53
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.' ) ;
55
55
return ;
56
56
}
57
57
58
58
59
- const itemToAdd : Item = { itemId : details . itemId , amount : 0 }
59
+ const itemToAdd : Item = { itemId : details . itemId , amount : 0 } ;
60
60
while ( countToRemove > 0 && playerInventory . has ( details . itemId ) ) {
61
61
const invIndex = playerInventory . findIndex ( details . itemId ) ;
62
62
const invItem = playerInventory . items [ invIndex ] ;
@@ -91,18 +91,18 @@ export const withdrawItem: itemAction = (details) => {
91
91
return ;
92
92
}
93
93
let countToRemove : number ;
94
- if ( details . option . endsWith ( " all" ) ) {
94
+ if ( details . option . endsWith ( ' all' ) ) {
95
95
countToRemove = - 1 ;
96
96
} else {
97
- countToRemove = + details . option . replace ( " withdraw-" , "" ) ;
97
+ countToRemove = + details . option . replace ( ' withdraw-' , '' ) ;
98
98
}
99
99
100
100
const playerBank : ItemContainer = details . player . bank ;
101
101
const playerInventory : ItemContainer = details . player . inventory ;
102
102
const slotWithItem : number = playerBank . findIndex ( details . itemId ) ;
103
- let itemAmount : number = playerBank . items [ slotWithItem ] . amount ;
103
+ const itemAmount : number = playerBank . items [ slotWithItem ] . amount ;
104
104
if ( countToRemove == - 1 || countToRemove > itemAmount ) {
105
- countToRemove = itemAmount
105
+ countToRemove = itemAmount ;
106
106
}
107
107
108
108
if ( ! details . itemDetails . stackable ) {
@@ -113,12 +113,12 @@ export const withdrawItem: itemAction = (details) => {
113
113
}
114
114
115
115
if ( ! playerInventory . canFit ( { itemId : details . itemId , amount : countToRemove } ) ) {
116
- details . player . sendMessage ( " Your inventory is full." ) ;
116
+ details . player . sendMessage ( ' Your inventory is full.' ) ;
117
117
return ;
118
118
}
119
119
120
120
121
- const itemToAdd : Item = { itemId : details . itemId , amount : 0 }
121
+ const itemToAdd : Item = { itemId : details . itemId , amount : 0 } ;
122
122
while ( countToRemove > 0 && playerBank . has ( details . itemId ) ) {
123
123
const invIndex = playerBank . findIndex ( details . itemId ) ;
124
124
const invItem = playerBank . items [ invIndex ] ;
@@ -129,7 +129,7 @@ export const withdrawItem: itemAction = (details) => {
129
129
} else {
130
130
itemToAdd . amount += countToRemove ;
131
131
invItem . amount -= countToRemove ;
132
- countToRemove = 0
132
+ countToRemove = 0 ;
133
133
}
134
134
}
135
135
playerInventory . addStacking ( itemToAdd ) ;
0 commit comments