Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Chapter 66] Tooltip bug on casting a targeted spell

Aperta
#231 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
game-dev

Direzione di ricerca

Inizia da chapter-66-spells/src/inventory_system/mod.rs alla riga 41 e chapter-66-spells/src/gui.rs alla riga 51, poi segui il modo in cui draw_tooltips, get_item_display_name e obfuscate_name gestiscono le entità con Position ma senza Name. Riproduci il problema lanciando un incantesimo mirato come Zap mentre passi il cursore su una casella. Il lavoro è completato quando la particella prevista non produce più un tooltip Nameless item (bug) e le funzioni nominate sono state rifattorizzate per evitare i bug segnalati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

https://github.com/amethyst/rustrogueliketutorial/blob/33872fe582f226178436847e1f74eafcbf9c0d1a/chapter-66-spells/src/inventory_system/mod.rs#L41
https://github.com/amethyst/rustrogueliketutorial/blob/33872fe582f226178436847e1f74eafcbf9c0d1a/chapter-66-spells/src/gui.rs#L51

When casting a targeted spell (like Zap), a tooltip will be displayed with the Nameless item (bug) string.

This is because the tooltip logic will loop on every entity with a Position component and try to display it.
However, when spawning a Particle, it is expected for it to have a Position but no Name.
When casting the spell, a Particle is spawned on the exact tile the player is hovering, so the draw_tooltips logic catches it and tries to display it. But since it has no Name (which is expected), it displays this string.

We need to either:

  1. Filter entities we pass to get_item_display_name differently so particles are omitted
  2. Return None for an entity with no Name component

Additionally, the code for get_item_display_name and obfuscate_name should be refactored to avoid bugs.
(get_item_display_name could simply get the proper stores and call obfuscate_name.)

Lingua principale
Rust
Stelle
968
Fork
166
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di amethyst/rustrogueliketutorial

Tutte le issue di amethyst/rustrogueliketutorial

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.