🐞 fix(稷下学宫): 修改恢复hp时过滤hp为0的情况
This commit is contained in:
@@ -961,7 +961,9 @@ export async function updateMaxHp(roleId: string, gameCode: string, type: number
|
||||
if (tempMaxHp == val.maxHp && updateCharasMap && !updateCharasMap.has(val.charaCode)) continue;
|
||||
let preMaxHp = val.maxHp;
|
||||
val.maxHp = tempMaxHp;
|
||||
val.hp = Math.min(val.hp + tempMaxHp - preMaxHp, tempMaxHp);
|
||||
if (val.hp > 0) {
|
||||
val.hp = Math.min(val.hp + tempMaxHp - preMaxHp, tempMaxHp);
|
||||
}
|
||||
result.push(val);
|
||||
}
|
||||
await RougelikeCharaModel.bulkWriteUpdate(result);
|
||||
|
||||
Reference in New Issue
Block a user