计算ap的时候, 判断player是否为空

This commit is contained in:
zhl 2020-12-15 11:05:41 +08:00
parent 9f9971bff3
commit 7ba01534ad

View File

@ -248,6 +248,9 @@ let gameUtil = {
*/
calcTotalAp(player: Player) {
let result = 0;
if (!player) {
return result;
}
for (let [pid, pet] of player.pets) {
result += pet.ap;
}