Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Successful Knock Spell Pointed Down Incorrectly Assumes Bear Trap

Offen
#129 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
52/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
c
Bereich
game-dev

Rechercherichtung

Beginne in src/zap.c beim SPE_KNOCK-Zweig in zapupdown und vergleiche dessen Bear-Trap-Behandlung mit libnethack/zap.c. Reproduziere das Aufstoßen einer Truhe nach unten und überprüfe anschließend, dass die Meldung nicht mehr behauptet, eine Bärenfalle sei geöffnet worden, wenn der Spieler nicht gefangen ist, während das tatsächliche Verhalten von Bärenfallen intakt bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

Knocking open a chest downward produces the message "The bear trap opens. Klick!".
This is not at all indicative, as one might think, of a hitherto undiscovered beartrap that you happen to be standing on, but it is instead a bug, as zapupdown in src/zap.c indicates:

        case SPE_KNOCK:
            /* up or down, but at closed portcullis only */
            if (is_db_wall(x,y) && find_drawbridge(&xx, &yy)) {
                open_drawbridge(xx, yy);
                disclose = TRUE;
            } else if (u.dz > 0 && (x == xdnstair && y == ydnstair) &&
                        /* can't use the stairs down to quest level 2 until
                           leader "unlocks" them; give feedback if you try */
                        on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
                pline_The("stairs seem to ripple momentarily.");
                disclose = TRUE;
            } else if (u.utraptype == TT_BEARTRAP) {
                pline_The("bear trap opens.");
                u.utrap = 0;
            }

However, TT_BEARTRAP happens to be 0, which apparently what u.utraptype is set to /even if you're not in a trap/.

... this does not appear to be a problem in NetHack 4, where libnethack/zap.c's zapupdown covers this case as:

    case SPE_KNOCK:
        /* up or down, but at closed portcullis only */
        if (is_db_wall(x, y) && find_drawbridge(&xx, &yy)) {
            open_drawbridge(xx, yy);
            disclose = TRUE;
        } else if (dz > 0 && (x == level->dnstair.sx && y == level->dnstair.sy)
                   &&
                   /* can't use the stairs down to quest level 2 until leader
                      "unlocks" them; give feedback if you try */
                   on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
            pline("The stairs seem to ripple momentarily.");
            disclose = TRUE;
        }
Vorherrschende Sprache
C
Sterne
24
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ComputerScienceHouse/bingehack

Alle Issues in ComputerScienceHouse/bingehack

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.