From e9e79ad696c053e1c1b7fad0c5943ba9d99d5ad5 Mon Sep 17 00:00:00 2001 From: Hokken Date: Sun, 8 Feb 2026 11:45:03 +0000 Subject: [PATCH] Fix LootRollLevel=1 to match documented 'greed' behavior (#2068) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fixes `AiPlayerbot.LootRollLevel = 1` to actually behave as "greed" mode per the config documentation. ## Problem The config documentation states: ```conf # Bots' loot roll level (0 = pass, 1 = greed, 2 = need) # Default: 1 (greed) AiPlayerbot.LootRollLevel = 1 ``` However, level 1 was converting **all GREED votes to PASS**, causing bots to pass on almost everything: | Item Type | AI Decision | Level 1 Behavior (Before) | Expected | |-----------|-------------|---------------------------|----------| | Gear upgrade | NEED | GREED ✓ | GREED | | Usable gear (not upgrade) | GREED | **PASS** ✗ | GREED | | Crafting materials | GREED | **PASS** ✗ | GREED | | Recipes, consumables | GREED | **PASS** ✗ | GREED | The only items bots would greed on were direct gear upgrades (originally NEED, downgraded to GREED). ## Root Cause In `LootRollAction.cpp`, lines 104-107 were converting GREED to PASS: ```cpp else if (vote == GREED) { vote = PASS; // This breaks "greed" mode } ``` ## Fix Remove the GREED→PASS conversion. Level 1 now only downgrades NEED to GREED (as intended), preserving GREED votes for useful items. ## Behavior After Fix | Level | Description | Behavior | |-------|-------------|----------| | 0 | Pass | Always pass on all items | | 1 | Greed | Greed on useful items, never need | | 2 | Need | Full AI logic (need/greed/pass) | ## Test Plan - [ ] Set `AiPlayerbot.LootRollLevel = 1` - [ ] Kill mobs that drop crafting materials, recipes, or non-upgrade gear - [ ] Verify bots greed on useful items instead of passing - [ ] Verify bots still pass on junk items - [ ] Verify bots never roll need (only greed) Co-authored-by: Hokken --- src/Ai/Base/Actions/LootRollAction.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Ai/Base/Actions/LootRollAction.cpp b/src/Ai/Base/Actions/LootRollAction.cpp index e600f1f20..9a21c8139 100644 --- a/src/Ai/Base/Actions/LootRollAction.cpp +++ b/src/Ai/Base/Actions/LootRollAction.cpp @@ -90,6 +90,8 @@ bool LootRollAction::Execute(Event event) } else if (sPlayerbotAIConfig.lootRollLevel == 1) { + // Level 1 = "greed" mode: bots greed on useful items but never need + // Only downgrade NEED to GREED, preserve GREED votes as-is if (vote == NEED) { if (RollUniqueCheck(proto, bot)) @@ -101,10 +103,6 @@ bool LootRollAction::Execute(Event event) vote = GREED; } } - else if (vote == GREED) - { - vote = PASS; - } } switch (group->GetLootMethod()) {