refactor(main): 优化物品使用逻辑
- 修复了物品使用时的变量引用问题 - 引入了 const 关键字来定义不变的变量 - 优化了代码格式,提高了可读性
This commit is contained in:
@@ -20290,11 +20290,13 @@ var app;
|
||||
break;
|
||||
case this.sure:
|
||||
if (0 != this.itemID && this.curItem) {
|
||||
const curItem = this.curItem;
|
||||
const itemId = this.itemID;
|
||||
const batchUse = (num) => {
|
||||
const batchMax = 99;
|
||||
return (() =>{
|
||||
return (() => {
|
||||
setTimeout(() => {
|
||||
t.ThgMu.ins().send_8_11(this.itemID, Math.min(num, batchMax), this.curItem.series);
|
||||
t.ThgMu.ins().send_8_11(itemId, Math.min(num, batchMax), curItem.series);
|
||||
num -= batchMax;
|
||||
if (num > batchMax) {
|
||||
batchUse(num);
|
||||
|
||||
Reference in New Issue
Block a user