洗炼重复锁定判断

This commit is contained in:
luying
2020-12-23 10:21:03 +08:00
parent e77d592502
commit 5a6f574541
2 changed files with 10 additions and 5 deletions
@@ -221,7 +221,11 @@ export class EquipHandler {
let { randSe } = equip;
if (!randSe || randSe.length <= 0) {
return resResult(STATUS.EQUIP_HAVE_NO_RANDSE);
return resResult(STATUS.ROLE_EQUIP_HAVE_NO_RANDSE);
}
let curSe = randSe.find(cur => cur.id == id);
if(!curSe || lock == curSe.locked) {
return resResult(STATUS.ROLE_EQUIP_DUPLICATE_LOCK);
}
if (lock) { // 仅在上锁时消耗,根据已有的锁的数量判断消耗
@@ -242,7 +246,7 @@ export class EquipHandler {
let result = await EquipModel.lock(roleId, eid, id, lock);
if (!result) {
return resResult(STATUS.EQUIP_HAVE_NO_RANDSE);
return resResult(STATUS.ROLE_EQUIP_HAVE_NO_RANDSE);
}
return resResult(STATUS.SUCCESS, { curEquip: result });
@@ -260,7 +264,7 @@ export class EquipHandler {
let {id, randSe, hid, ePlaceId } = equip;
if(!randSe || randSe.length <= 0 ) {
return resResult(STATUS.EQUIP_HAVE_NO_RANDSE);
return resResult(STATUS.ROLE_EQUIP_HAVE_NO_RANDSE);
}
let dicGoods = gameData.goods.get(id);