[Tasks] Only update loot tasks for NPC corpses (#2513)

This fixes a bug that allowed looting items from a player's corpse to
increment a task if it didn't have an npc target defined. It looks
like this bug existed before the changes in 7482cfc0.

This also now passes count for task loot updates to handle item stacks.

Also fixes incorrectly casting Corpse to NPC on loot update
This commit is contained in:
hg authored and GitHub committed 2022-11-05 11:13:02 -04:00
1 parent f6dbdf5db8
commit 070bf64d6a
6 files changed
+44 -27

No files matched your search

+2 -2
View File
@@ -367,7 +367,7 @@ void Client::GoFish()
PushItemOnCursor(*inst);
SendItemPacket(EQ::invslot::slotCursor, inst, ItemPacketLimbo);
if (RuleB(TaskSystem, EnableTaskSystem))
UpdateTasksForItem(TaskActivityType::Fish, nullptr, food_id);
UpdateTasksForItem(TaskActivityType::Fish, food_id);
safe_delete(inst);
inst = m_inv.GetItem(EQ::invslot::slotCursor);
@@ -486,7 +486,7 @@ void Client::ForageItem(bool guarantee) {
PushItemOnCursor(*inst);
SendItemPacket(EQ::invslot::slotCursor, inst, ItemPacketLimbo);
if(RuleB(TaskSystem, EnableTaskSystem)) {
UpdateTasksForItem(TaskActivityType::Forage, nullptr, foragedfood);
UpdateTasksForItem(TaskActivityType::Forage, foragedfood);
}
safe_delete(inst);