From 9a817e1708c4b490c5090d40e3faba5c12d9bb50 Mon Sep 17 00:00:00 2001 From: Contributor Date: Fri, 8 May 2026 09:47:13 -0400 Subject: [PATCH] Fix showman_double_legendary and perkeo_observatory filter bugs Amp-Thread-ID: https://ampcode.com/threads/T-019e075a-47ab-748b-8153-66fc5c952b07 Co-authored-by: Amp --- filters/perkeo_observatory.cl | 6 +++++- filters/showman_double_legendary.cl | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/filters/perkeo_observatory.cl b/filters/perkeo_observatory.cl index b588643..651f102 100644 --- a/filters/perkeo_observatory.cl +++ b/filters/perkeo_observatory.cl @@ -19,7 +19,11 @@ long filter(instance* inst) { } else continue; for (int c = 0; c < _pack.size; c++) { if (cards[c] == The_Soul) { - if (next_joker(inst, S_Soul, antes[i]) == Perkeo) return 1; + // Fix: Properly manage lock state for The_Soul and generated legendary + inst->locked[The_Soul] = false; + item legendary = next_joker(inst, S_Soul, antes[i]); + inst->locked[legendary] = true; + if (legendary == Perkeo) return 1; } } } diff --git a/filters/showman_double_legendary.cl b/filters/showman_double_legendary.cl index e01dcad..75abe24 100644 --- a/filters/showman_double_legendary.cl +++ b/filters/showman_double_legendary.cl @@ -8,7 +8,11 @@ long filter(instance* inst) { return 0; } - if (next_shop_item(inst, ante).value != Showman && next_shop_item(inst, ante).value != Showman) { + // Fix: Store shop items to avoid calling next_shop_item() twice + // Each call advances RNG state, so we need to capture both items + shopitem item1 = next_shop_item(inst, ante); + shopitem item2 = next_shop_item(inst, ante); + if (item1.value != Showman && item2.value != Showman) { return 0; }