From cafb4501634dea55133dd868575904e195f1c7a8 Mon Sep 17 00:00:00 2001 From: hexhexD Date: Thu, 11 Jan 2024 22:28:26 -0800 Subject: [PATCH] Add back item take logic in finishAttacking item take in actor_died_or_disappeared is only for itemsTakeAuto_party --- src/AI/Attack.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/AI/Attack.pm b/src/AI/Attack.pm index 6f7d689ed0..2aa1c824d1 100644 --- a/src/AI/Attack.pm +++ b/src/AI/Attack.pm @@ -236,8 +236,15 @@ sub finishAttacking { Plugins::callHook('target_died', {monster => $monsters_old{$ID}}); monKilled(); - # Cheap way to suspend all movement to make it look real - ai_clientSuspend(0, $timeout{'ai_attack_waitAfterKill'}{'timeout'}); + # Pickup loot when monster's dead + if (AI::state == AI::AUTO && $config{'itemsTakeAuto'} && $monsters_old{$ID}{dmgFromYou} > 0 && !$monsters_old{$ID}{ignore}) { + AI::clear("items_take"); + ai_items_take($monsters_old{$ID}{pos}{x}, $monsters_old{$ID}{pos}{y}, + $monsters_old{$ID}{pos_to}{x}, $monsters_old{$ID}{pos_to}{y}); + } else { + # Cheap way to suspend all movement to make it look real + ai_clientSuspend(0, $timeout{'ai_attack_waitAfterKill'}{'timeout'}); + } ## kokal start ## mosters counting