Skip to content

Items without color definitions cause debug message #80821

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

Open
BevapDin opened this issue May 4, 2025 · 0 comments
Open

Items without color definitions cause debug message #80821

BevapDin opened this issue May 4, 2025 · 0 comments
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@BevapDin
Copy link
Contributor

BevapDin commented May 4, 2025

Describe the bug

The item "plastic sheet" (id "plastic_sheet_small") has no color in its definition (file "data/json/items/resources/plastic.json").

When an item of that type is on the map and it gets highlighted, a debug message appears, complaining about the invalid color. May only appear in the curses version.

16:42:50.139 ERROR : src/color.cpp:147 [color_id color_manager::color_to_id(const nc_color &) const] Couldn't find color 0

GDB backtrace:

#0  0x00007f42aa2cb12e in read () from /lib64/libc.so.6
#1  0x00007f42aaa13f2d in ?? () from /lib64/libncursesw.so.6
#2  0x00007f42aaa14849 in wgetch () from /lib64/libncursesw.so.6
#3  0x0000557728ae7466 in input_manager::get_input_event (this=0x557729ab1178 <inp_mngr>) at src/ncurses_def.cpp:429
#4  0x0000557727faed73 in debug_error_prompt (filename=filename@entry=0x557729388abc "src/color.cpp", line=<optimized out>, line@entry=0x5577293e3152 "147",  funcname=funcname@entry=0x557729388b3b "color_id color_manager::color_to_id(const nc_color &) const", text=<optimized out>, force=<optimized out>) at src/debug.cpp:385
#5  0x0000557727faf302 in realDebugmsg (filename=0x557729388abc "src/color.cpp", line=0x5577293e3152 "147",  funcname=0x557729388b3b "color_id color_manager::color_to_id(const nc_color &) const", text="Couldn't find color 0") at src/debug.cpp:559
#6  0x0000557727e6d6cf in realDebugmsg<int> (filename=0x0, line=0x7fff01656adf "", funcname=0x1 <error: Cannot access memory at address 0x1>, mes=<optimized out>, args=@0x7fff01657080: 0) at src/debug.h:82
#7  color_manager::color_to_id (this=this@entry=0x557729a81758 <get_all_colors()::single_instance>, color=...) at src/color.cpp:147
#8  0x0000557727e763b4 in color_manager::get_invert (this=0x557729a81758 <get_all_colors()::single_instance>, color=...) at src/color.cpp:171
#9  invert_color (c=...) at src/color.cpp:546
#10 0x0000557728748792 in map::draw_maptile (this=this@entry=0x55772be1fb50, w=..., p=..., curr_maptile=..., params=...) at src/map.cpp:7204
#11 0x0000557728748f89 in map::drawsq (this=0x55772be1fb50, w=..., p=..., params=...) at src/map.cpp:7006
#12 0x0000557728213652 in game::draw_look_around_cursor (this=<optimized out>, lp=..., cache=...) at src/game.cpp:6625
#13 0x00005577281ff6ac in std::function<void ()>::operator()() const (this=<optimized out>) at /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/std_function.h:591
#14 game::draw_callback_t::operator() (this=<optimized out>) at src/game.cpp:4019
#15 game::draw (this=0x55772c04a540, ui=...) at src/game.cpp:4187
#16 0x00005577291c5d30 in std::function<void (ui_adaptor&)>::operator()(ui_adaptor&) const (this=0x55772c4f2348, __args=...) at /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/std_function.h:591
#17 ui_adaptor::redraw_invalidated () at src/ui_manager.cpp:450
#18 0x000055772821c5d5 in game::look_around (this=this@entry=0x55772c04a540, show_window=true, center=..., start_point=..., has_first_point=false, select_zone=<optimized out>, peeking=<optimized out>, is_moving_zone=<optimized out>, end_point=..., change_lv=<optimized out>) at src/game.cpp:8137
#19 0x000055772821db44 in game::look_around (this=0x55772c04a540) at src/game.cpp:7928
#20 0x00005577282d0f0c in do_deathcam_action (act=@0x7fff016579fc: ACTION_LOOK, player_character=...) at src/handle_action.cpp:2188
#21 game::handle_action (this=0x55772c04a540) at src/handle_action.cpp:3308
#22 0x000055772807cbba in do_turn () at src/do_turn.cpp:589
#23 0x0000557728710a5e in main (argc=1, argv=<optimized out>) at src/main.cpp:864

Attach save file

N/A

Steps to reproduce

Spawn a "plastic sheet".
Drop it on the map, on an empty normal floor tile (one that shows up as "."). The item should be visible on the floor as a ",". it should be the only item there.
Highlight the tile (use the "Look Around" feature).
Get the message.

Expected behavior

No debug message.

Even better would be a check during the loading of the item definitions that all items have a valid color.

Screenshots

No response

Versions and configuration

OS: Linux
- OS Version:

  • Game Version: adfc3ea [64-bit]
  • Graphics Version: Curses
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms]
    ]

Additional context

No response

@BevapDin BevapDin added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

No branches or pull requests

1 participant