Commit 8cfb25d7c77c001f51cd2230dc41f30020b7e087

Authored by zhouhaihai
1 parent 36875ec5

传递 敌人信息

Showing 2 changed files with 2 additions and 4 deletions   Show diff stats
src/actions/AdvAction.lua
... ... @@ -746,7 +746,7 @@ function _M.endBattleRpc(agent, data)
746 746 end
747 747 end
748 748 adv:mylog({desc = "endBattle"})
749   - local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill})
  749 + local status = adv:clickBlock(roomId, blockId, {player = player, enemy = msg.enemy, bySkill = bySkill})
750 750  
751 751 if not status then return end
752 752 SendPacket(actionCodes.Adv_endBattleRpc, MsgPack.pack({events = adv:popBackEvents()}))
... ...
src/adv/AdvBattle.lua
... ... @@ -366,9 +366,7 @@ function Battle:battleBegin(roomId, blockId, params)
366 366 if not enemy then return end
367 367 local player = params.player
368 368 if not player then return end
369   - local penemy = params.enemy
370   - if not penemy then return end
371   -
  369 + local penemy = params.enemy or {hp = 0}
372 370 if player.hp ~= 0 then
373 371 if penemy.hp <= 0 then
374 372 enemy:kill()
... ...