fix 奇遇无法刷出

This commit is contained in:
luying
2021-01-09 15:35:05 +08:00
parent 6fae9646c9
commit be77ffab3f
5 changed files with 16 additions and 7 deletions

View File

@@ -5,12 +5,14 @@ import { fromCallback } from 'bluebird';
import { checkPvp, findPvpDefByRoleId } from '../services/pvpService'
import { getFuncsSwitch } from '../pubUtils/data';
import { FUNCS_ID, FUNC_OPT_TYPE } from '../consts/constModules/sysConst';
import { RoleModel } from '../db/Role'
import { RoleModel } from '../db/Role';
import { startEvent } from "./eventSercive";
export async function eventOnPlayerLvUp(roleId: string, lv: number, addFuncs: Array<number>, dataFuncs: Array<number>) {
if (!dataFuncs.includes(FUNCS_ID.PVP)) {//开启pvp
let res = getFuncsSwitch(FUNCS_ID.PVP);
if (!res || lv >= res.param) {
if (res && lv >= res.param) {
let role = await RoleModel.findByRoleId(roleId);
await checkPvp(role);
addFuncs.push(FUNCS_ID.PVP);
@@ -19,7 +21,7 @@ export async function eventOnPlayerLvUp(roleId: string, lv: number, addFuncs: Ar
if (!dataFuncs.includes(FUNCS_ID.EVENT)) {//开启奇遇
let res = getFuncsSwitch(FUNCS_ID.EVENT);
if (!res || lv >= res.param) {
if (res && lv >= res.param) {
addFuncs.push(FUNCS_ID.EVENT);
}
}