From bb4dd45b0df4badff1c01b99cbef42a0e4aeb736 Mon Sep 17 00:00:00 2001 From: Elvis Oliveira Date: Fri, 15 Sep 2023 19:55:57 +0200 Subject: [PATCH] add attackLooters_dist (#3788) --- control/config.txt | 1 + src/Network/Receive.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/control/config.txt b/control/config.txt index ed6a1e2ea7..b8d26f6d31 100644 --- a/control/config.txt +++ b/control/config.txt @@ -86,6 +86,7 @@ attackCanSnipe 0 attackCheckLOS 0 attackRouteMaxPathDistance 13 attackLooters 0 +attackLooters_dist 1 attackChangeTarget 1 aggressiveAntiKS 0 diff --git a/src/Network/Receive.pm b/src/Network/Receive.pm index d37402fe22..4e4f904718 100644 --- a/src/Network/Receive.pm +++ b/src/Network/Receive.pm @@ -7052,7 +7052,7 @@ sub item_disappeared { || ($control->{attack_sp} ne "" && $control->{attack_sp} > $char->{sp}) ); } - if (distance($item->{pos}, $monster->{pos}) == 0) { + if (distance($item->{pos}, $monster->{pos}) <= ($config{attackLooters_dist} || 0)) { attack($monster->{ID}); message TF("Attack Looter: %s looted %s\n", $monster->nameIdx, $item->{name}), "looter"; last;