CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.67k stars 4.18k forks source link

Error when tried to fill container #28829

Closed dmtrygrey closed 5 years ago

dmtrygrey commented 5 years ago

Describe the bug
I've got an error message when I've tried to fill plastic canteen from another container with water.

To Reproduce
Load save I've attached and try to reload plastic canteen. save.zip

Screenshots
scr

Versions and configuration(please complete the following information):

DEBUG LOG

21:00:58.986 : Starting log.
21:00:58.986 INFO : Cataclysm DDA version 0.D-732-g54c33887e1
21:00:58.987 INFO : Number of render drivers on your system: 3
21:00:58.987 INFO : Render driver: 0/opengl
21:00:58.987 INFO : Render driver: 1/opengles2
21:00:58.987 INFO : Render driver: 2/software
21:00:59.152 INFO : SDL version used during compile is 2.0.9
21:00:59.152 INFO : SDL version used during linking and in runtime is 2.0.9
21:00:59.279 INFO : Active renderer: 1/opengles2
21:00:59.395 INFO : USE_COLOR_MODULATED_TEXTURES is set to 0
21:00:59.433 WARNING : opendir [./mods/] failed with "No such file or directory".
21:01:02.257 WARNING : opendir [./save/Hopkins/mods] failed with "No such file or directory".
21:01:07.987 INFO : Loaded tileset: MSX++DEAD_PEOPLE
21:01:13.775 ERROR : (error message will follow backtrace)
    ./cataclysm-tiles(_Z21debug_write_backtraceRSo+0x2f) [0x55e21dd57f68]
    ./cataclysm-tiles(_Z8DebugLog10DebugLevel10DebugClass+0x104) [0x55e21dd584bd]
    ./cataclysm-tiles(_Z12realDebugmsgPKcS0_S0_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x134) [0x55e21dd589ea]
    ./cataclysm-tiles(_Z12realDebugmsgIJPKcEEvS1_S1_S1_S1_DpOT_+0x5b) [0x55e21dc7fc86]
    ./cataclysm-tiles(_ZNK6player16item_reload_costERK4itemS2_l+0xd8) [0x55e21e173f84]
    ./cataclysm-tiles(_ZNK4item13reload_option5movesEv+0x41) [0x55e21de8089b]
    ./cataclysm-tiles(_ZN4game6reloadER13item_locationb+0x51d) [0x55e21dde79a3]
    ./cataclysm-tiles(_ZN4game6reloadEv+0x32d) [0x55e21dde7ef5]
    ./cataclysm-tiles(_ZN4game13handle_actionEv+0x25bf) [0x55e21de35da7]
    ./cataclysm-tiles(_ZN4game7do_turnEv+0x2de) [0x55e21ddfdece]
    ./cataclysm-tiles(main+0x159b) [0x55e21dc2685a]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7f753985109b]
    ./cataclysm-tiles(_start+0x2a) [0x55e21dc51b6a]

    Attempting to repeat stack trace using debug symbols...
    debug_write_backtrace(std::ostream&)
    ??:?
    DebugLog(DebugLevel, DebugClass)
    ??:?
    realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    ??:?
    void realDebugmsg<char const*>(char const*, char const*, char const*, char const*, char const*&&)
    ??:?
    player::item_reload_cost(item const&, item const&, long) const
    ??:?
    item::reload_option::moves() const
    ??:?
    game::reload(item_location&, bool)
    ??:?
    game::reload()
    ??:?
    game::handle_action()
    ??:?
    game::do_turn()
    ??:?
    main
    ??:?
    __libc_start_main
    /build/glibc-d2N3Ld/glibc-2.28/csu/../csu/libc-start.c:342
    _start
    ??:?
Backtrace emission took 1 seconds.
src/player.cpp:8251 [int player::item_reload_cost(const item&, const item&, long int) const] cannot determine reload cost as hemostatic powder is neither ammo or magazine
21:01:15.590 : Log shutdown.
dmtrygrey commented 5 years ago

@ZhilkinSerg I just check in version 0.D-873-ge87ef58ec5 the problem still there

dmtrygrey commented 5 years ago
20:39:57.741 INFO : Cataclysm DDA version 0.D-873-ge87ef58ec5
20:39:57.743 INFO : Number of render drivers on your system: 3
20:39:57.743 INFO : Render driver: 0/opengl
20:39:57.743 INFO : Render driver: 1/opengles2
20:39:57.743 INFO : Render driver: 2/software
20:39:57.914 INFO : SDL version used during compile is 2.0.9
20:39:57.914 INFO : SDL version used during linking and in runtime is 2.0.9
20:39:58.039 INFO : Active renderer: 1/opengles2
20:39:58.158 INFO : USE_COLOR_MODULATED_TEXTURES is set to 0
20:39:58.197 WARNING : opendir [./mods/] failed with "No such file or directory".
20:40:01.204 WARNING : opendir [./save/Hopkins/mods] failed with "No such file or directory".
20:40:07.117 INFO : Loaded tileset: MSX++DEAD_PEOPLE
20:40:15.894 ERROR : (error message will follow backtrace)
    ./cataclysm-tiles(_Z21debug_write_backtraceRSo+0x2f) [0x55d1b9e77e1c]
    ./cataclysm-tiles(_Z8DebugLog10DebugLevel10DebugClass+0x104) [0x55d1b9e78371]
    ./cataclysm-tiles(_Z12realDebugmsgPKcS0_S0_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x134) [0x55d1b9e7889e]
    ./cataclysm-tiles(_Z12realDebugmsgIJPKcEEvS1_S1_S1_S1_DpOT_+0x5b) [0x55d1b9d9fad6]
    ./cataclysm-tiles(_ZNK6player16item_reload_costERK4itemS2_l+0xd8) [0x55d1ba2959c0]
    ./cataclysm-tiles(_ZNK4item13reload_option5movesEv+0x41) [0x55d1b9fa0693]
    ./cataclysm-tiles(_ZN4game6reloadER13item_locationb+0x51d) [0x55d1b9f078e1]
    ./cataclysm-tiles(_ZN4game6reloadEv+0x32d) [0x55d1b9f07e33]
    ./cataclysm-tiles(_ZN4game13handle_actionEv+0x25bf) [0x55d1b9f55d57]
    ./cataclysm-tiles(_ZN4game7do_turnEv+0x2de) [0x55d1b9f1de0c]
    ./cataclysm-tiles(main+0x159b) [0x55d1b9d46644]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7fc7e400709b]
    ./cataclysm-tiles(_start+0x2a) [0x55d1b9d7198a]

    Attempting to repeat stack trace using debug symbols...
    debug_write_backtrace(std::ostream&)
    ??:?
    DebugLog(DebugLevel, DebugClass)
    ??:?
    realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    ??:?
    void realDebugmsg<char const*>(char const*, char const*, char const*, char const*, char const*&&)
    ??:?
    player::item_reload_cost(item const&, item const&, long) const
    ??:?
    item::reload_option::moves() const
    ??:?
    game::reload(item_location&, bool)
    ??:?
    game::reload()
    ??:?
    game::handle_action()
    ??:?
    game::do_turn()
    ??:?
    main
    ??:?
    __libc_start_main
    /build/glibc-d2N3Ld/glibc-2.28/csu/../csu/libc-start.c:342
    _start
    ??:?
Backtrace emission took 1 seconds.
src/player.cpp:8267 [int player::item_reload_cost(const item&, const item&, long int) const] cannot determine reload cost as hemostatic powder is neither ammo or magazine
20:40:21.641 ERROR : src/item.cpp:5844 [bool item::reload(player&, item_location, long int)] Tried to reload liquid container with non-liquid.
20:40:24.845 : Log shutdown.
ZhilkinSerg commented 5 years ago

Thanks. Link to current issue in that PR was wrong.

lscruz commented 5 years ago

Same error was reported here https://github.com/CleverRaven/Cataclysm-DDA/issues/28781 I had a similar error unloading a bugged magazine containing a chest rig container bug

Yours seems to be asking for reload cost of "hemostatic powder" can you confirm where that item is located?

dmtrygrey commented 5 years ago

Yours seems to be asking for reload cost of "hemostatic powder" can you confirm where that item is located?

The bag with "hemostatic powder" is in inventory.

lscruz commented 5 years ago

Ok, this is happening because player's ammo_location has 'hemostatic powder' location set and it's trying to reload from it instead of giving a prompt. Reloading seems kinda messed up now as 'r' wielding a bow is crashing for me.

As for now, wielding anything else and trying to reload with 'r' might clear ammo_location then reloading the canteen from inventory works.

dmtrygrey commented 5 years ago

Ok, this is happening because player's ammo_location has 'hemostatic powder' location set and it's trying to reload from it instead of giving a prompt. Reloading seems kinda messed up now as 'r' wielding a bow is crashing for me.

As for now, wielding anything else and trying to reload with 'r' might clear ammo_location then reloading the canteen from inventory works.

I tried to wield something else and nothing at all, it doesn't work. "r" key is also doesn't work now, but when I dropped a bow "r" started to work fine, so bow might be related to #28920 As for reloading canteen. I dropped "hemostatic powder" far enough and tried to reload canteen via inventory menu and I got this error message:

src/item.cpp:5844 [bool item::reload(player&, item_location, long int)] Tried to reload liquid container with non-liquid.
20:49:56.053 ERROR : src/item.cpp:5844 [bool item::reload(player&, item_location, long int)] Tried to reload liquid container with non-liquid.
20:50:06.661 ERROR : src/item.cpp:5844 [bool item::reload(player&, item_location, long int)] Tried to reload liquid container with non-liquid.
20:50:18.437 ERROR : src/item.cpp:5844 [bool item::reload(player&, item_location, long int)] Tried to reload liquid container with non-liquid.
dmtrygrey commented 5 years ago

So I've done a few more tests. And it seems the problem happens when you wield a bow and press "r", only in this case reloading "plastic canteen" causes an error. But if you have bow wielded and haven't pressed "r" you can drop it somewhere and reload canteen fine. So the problem is actually lays is when you are trying to reload wielded bow.

UPD: You actually don't need to wield a bow, you just need to have it in your inventory for the error to show up.