道具:体力回复道具上限

This commit is contained in:
luying
2021-12-28 18:31:12 +08:00
parent 1ce862b719
commit 1dee1a73b4
2 changed files with 7 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ import { ActionPointModel } from "../../../db/ActionPoint";
import { GiftCodeDetailModel } from "../../../db/GiftCodeDetail";
import { GiftCodeType, GiftCodeModel } from "../../../db/GiftCode";
import { nowSeconds } from "../../../pubUtils/timeUtil";
import { AP } from "../../../pubUtils/dicParam";
export default function (app: Application) {
new HandlerService(app, {});
@@ -79,9 +80,13 @@ export class ItemHandler {
}
let role = await RoleModel.findByRoleId(roleId, 'lv');
let { isOver } = await getAp(roleId, ip, role.lv);
let { ap, isOver } = await getAp(roleId, ip, role.lv);
if (isOver) return resResult(STATUS.AP_IS_FULL);
if(ap + dicGoods.value * count > AP.AP_SAVE_MAX) {
return resResult(STATUS.AP_IS_FULL);
}
let consumeResult = await handleCost(roleId, sid, [{ id: id, count: count }], ITEM_CHANGE_REASON.USE_MEAT);
if (!consumeResult) return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);

View File

@@ -295,7 +295,7 @@ export async function recentPrivateChatInfos(roleId: string, roleName: string) {
}
})
.splice(CHAT_SYSTEM.RECENT_PRIVATE_CHATS_CNT);
if (!recentPrivateChats || !recentPrivateChats.length) return null;
if (!recentPrivateChats || !recentPrivateChats.length) return [];
const roleInfos = await RoleModel.findByRoleIds(recentPrivateChats.map(chat => { return chat.targetRoleId }));
const chatInfos = recentPrivateChats.map( chat => {