Skip to content

Commit

Permalink
Add back item take logic in finishAttacking (#3844)
Browse files Browse the repository at this point in the history
item take in actor_died_or_disappeared is only for itemsTakeAuto_party
  • Loading branch information
hexhexD committed Jan 12, 2024
1 parent 3fbb592 commit facc613
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/AI/Attack.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit facc613

Please sign in to comment.