Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chapter 66] Tooltip bug on casting a targeted spell #231

Open
PierreGuyot opened this issue Jan 14, 2025 · 0 comments
Open

[Chapter 66] Tooltip bug on casting a targeted spell #231

PierreGuyot opened this issue Jan 14, 2025 · 0 comments

Comments

@PierreGuyot
Copy link


"Nameless item (bug)".to_string()

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant