Skip to content

Commit

Permalink
[Hotfix] Fix issue with EVENT_HP firing regression from #2904 (#2924)
Browse files Browse the repository at this point in the history
* [Hotfix] Fix issue with EVENT_HP firing from #2904

* Fix

* Fix
  • Loading branch information
Akkadius authored Feb 14, 2023
1 parent 97edb09 commit 5b56a23
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions zone/mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1382,23 +1382,21 @@ void Mob::CreateHPPacket(EQApplicationPacket* app)
{
if (ds->hp < GetNextHPEvent())
{
SetNextHPEvent(-1);

if (parse->HasQuestSub(GetNPCTypeID(), EVENT_HP)) {
if (parse->HasQuestSub(CastToNPC()->GetNPCTypeID(), EVENT_HP)) {
parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, std::to_string(GetNextHPEvent()), 0);
}
SetNextHPEvent(-1);
}
}

if (IsNPC() && (GetNextIncHPEvent() > 0))
{
if (ds->hp > GetNextIncHPEvent())
{
SetNextIncHPEvent(-1);

if (parse->HasQuestSub(GetNPCTypeID(), EVENT_HP)) {
if (parse->HasQuestSub(CastToNPC()->GetNPCTypeID(), EVENT_HP)) {
parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, std::to_string(GetNextIncHPEvent()), 1);
}
SetNextIncHPEvent(-1);
}
}
}
Expand Down

0 comments on commit 5b56a23

Please sign in to comment.