fix 奇遇无法刷出
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user