You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Filter entities we pass to get_item_display_name differently so particles are omitted
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.)
The text was updated successfully, but these errors were encountered:
rustrogueliketutorial/chapter-66-spells/src/inventory_system/mod.rs
Line 41 in 33872fe
rustrogueliketutorial/chapter-66-spells/src/gui.rs
Line 51 in 33872fe
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 aPosition
but noName
.When casting the spell, a
Particle
is spawned on the exact tile the player is hovering, so thedraw_tooltips
logic catches it and tries to display it. But since it has noName
(which is expected), it displays this string.We need to either:
get_item_display_name
differently so particles are omittedNone
for an entity with noName
componentAdditionally, the code for
get_item_display_name
andobfuscate_name
should be refactored to avoid bugs.(
get_item_display_name
could simply get the proper stores and callobfuscate_name
.)The text was updated successfully, but these errors were encountered: