From 8cfb25d7c77c001f51cd2230dc41f30020b7e087 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Fri, 4 Dec 2020 11:23:17 +0800 Subject: [PATCH] 传递 敌人信息 --- src/actions/AdvAction.lua | 2 +- src/adv/AdvBattle.lua | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/actions/AdvAction.lua b/src/actions/AdvAction.lua index 16964bc..009b34c 100644 --- a/src/actions/AdvAction.lua +++ b/src/actions/AdvAction.lua @@ -746,7 +746,7 @@ function _M.endBattleRpc(agent, data) end end adv:mylog({desc = "endBattle"}) - local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) + local status = adv:clickBlock(roomId, blockId, {player = player, enemy = msg.enemy, bySkill = bySkill}) if not status then return end SendPacket(actionCodes.Adv_endBattleRpc, MsgPack.pack({events = adv:popBackEvents()})) diff --git a/src/adv/AdvBattle.lua b/src/adv/AdvBattle.lua index baab58d..cd2ce03 100644 --- a/src/adv/AdvBattle.lua +++ b/src/adv/AdvBattle.lua @@ -366,9 +366,7 @@ function Battle:battleBegin(roomId, blockId, params) if not enemy then return end local player = params.player if not player then return end - local penemy = params.enemy - if not penemy then return end - + local penemy = params.enemy or {hp = 0} if player.hp ~= 0 then if penemy.hp <= 0 then enemy:kill() -- libgit2 0.21.2