[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
2022-11-05 11:13:02 -04:00
committed by GitHub
parent f6dbdf5db8
commit 070bf64d6a
6 changed files with 44 additions and 27 deletions
+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);