Playerbot: honour blacklisted turn-ins when the bot is already at the ender

The wedge-remediation blacklists a turn-in the bot can't path to, and the
picker then skips it — but that also strands a bot that HAS reached the NPC:
it stands next to the quest giver with a complete quest, current_quest_id=0
([picker_none]), and never turns in (so the chain stalls). If the bot is
within ~40y of the resolved ender, the turn-in is trivially reachable — let
the picker select it despite the blacklist.
This commit is contained in:
devbox
2026-08-18 18:32:51 +10:00
parent c2a1632d6c
commit 877866f122
@@ -4820,8 +4820,20 @@ std::shared_ptr<BotSnapshot const> BotSnapshotBuilder::Build(Player* p, BotAI* b
// NPC — so the picker swaps to a reachable quest instead of
// re-choosing the unreachable breadcrumb forever. obj_id 0 is the
// whole-quest sentinel the remediation stamps for turn-in goals.
// EXCEPTION: if the bot is already standing at the ender, the
// turn-in is trivially reachable — the blacklist exists to avoid
// re-picking an UNREACHABLE goal, so don't let it strand a wedged
// bot that finally made it to the NPC (observed: bots parked next
// to the turn-in with [picker_none] doing nothing).
if (bot_ai && bot_ai->objective_blacklisted(q.quest_id, 0u, now_ms))
{
if (!q.ender_resolved) continue;
const float edx = q.ender_x - p->GetPositionX();
const float edy = q.ender_y - p->GetPositionY();
constexpr float kAtEnderSq = 40.0f * 40.0f;
if (edx * edx + edy * edy > kAtEnderSq)
continue;
}
// A same-map turn-in is the best possible breadcrumb; once
// we have one, stop looking. Otherwise keep the first any-map
// candidate (FIFO) but keep scanning for a same-map upgrade.