Skip to content

Commit

Permalink
修复重伤相关记录的数据处理问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tinymins committed Dec 8, 2016
1 parent cc99ce2 commit 0903cbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DBM/DBM_Core.lua
Expand Up @@ -224,7 +224,7 @@ function DBM.OnEvent(szEvent)
elseif szEvent == "SYS_MSG" then
if arg0 == "UI_OME_DEATH_NOTIFY" then
if not IsPlayer(arg1) then
D.OnDeath(arg1, arg3)
D.OnDeath(arg1, arg2)
end
elseif arg0 == "UI_OME_SKILL_CAST_LOG" then
D.OnSkillCast(arg1, arg2, arg3, arg0)
Expand Down Expand Up @@ -1262,7 +1262,7 @@ function D.OnCallMessage(szEvent, szContent, dwNpcID, szNpcName)
end

-- NPC死亡事件 触发倒计时
function D.OnDeath(dwCharacterID, szKiller)
function D.OnDeath(dwCharacterID, dwKiller)
local npc = GetNpc(dwCharacterID)
if npc then
local data = D.GetData("NPC", npc.dwTemplateID)
Expand Down
6 changes: 4 additions & 2 deletions RaidTools/DeathLog.lua
Expand Up @@ -132,10 +132,12 @@ end
-- 这里的szKiller有个很大的坑
-- 因为策划不喜欢写模板名称 导致NPC名字全是空的 摔死和淹死也是空
-- 这就特别郁闷
local function OnDeath(dwCharacterID, szKiller)
local function OnDeath(dwCharacterID, dwKiller)
if IsPlayer(dwCharacterID) and (JH_IsParty(dwCharacterID) or dwCharacterID == PLAYER_ID) then
dwCharacterID = dwCharacterID == PLAYER_ID and "self" or dwCharacterID
DEATH_LOG[dwCharacterID] = DEATH_LOG[dwCharacterID] or {}
local killer = (IsPlayer(dwKiller) and GetPlayer(dwKiller)) or (not IsPlayer(dwKiller) and GetNpc(dwKiller))
local szKiller = killer and killer.szName or ""
if DAMAGE_LOG[dwCharacterID] then
tinsert(DEATH_LOG[dwCharacterID], {
nCurrentTime = GetCurrentTime(),
Expand All @@ -161,7 +163,7 @@ end)

RegisterEvent("SYS_MSG", function()
if arg0 == "UI_OME_DEATH_NOTIFY" then -- 死亡记录
OnDeath(arg1, arg3)
OnDeath(arg1, arg2)
elseif arg0 == "UI_OME_SKILL_EFFECT_LOG" then -- 技能记录
OnSkillEffectLog(arg1, arg2, arg4, arg5, arg6, arg7, arg8, arg9)
elseif arg0 == "UI_OME_COMMON_HEALTH_LOG" then
Expand Down

0 comments on commit 0903cbd

Please sign in to comment.