Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent segfault when deconstructing improvised shelter
Previous segfault happened when trying to display the list of items that deconstruction would yield, but this terrain has no `deconstruct` json. This commit also adds a check with `debugmsg` for future such cases during the game startup validation. Previous crash being fixed: ``` Thread 1 "cataclysm-tiles" received signal SIGSEGV, Segmentation fault. 0x0000555555cb9602 in operator() (drop_group=..., __closure=<optimized out>) at src/construction.cpp:2049 2049 item_group::spawn_data_from_group( drop_group )->every_item_min_max(); (gdb) bt #0 0x0000555555cb9602 in operator() (drop_group=..., __closure=<optimized out>) at src/construction.cpp:2049 #1 0x0000555555cb9af2 in construct::do_turn_deconstruct (p=..., who=...) at src/construction.cpp:2086 #2 0x0000555555a32fad in activity_handlers::build_do_turn (act=0x5555583e4338, you=0x5555583e3c70) at src/activity_handlers.cpp:3424 #3 0x0000555555a6b7de in std::function<void(player_activity*, Character*)>::operator() (this=<optimized out>, __args#0=<optimized out>, __args#0@entry=0x5555583e4338, __args#1=<optimized out>, __args#1@entry=0x5555583e3c70) at /usr/include/c++/14/bits/std_function.h:591 #4 0x0000555555a69647 in activity_type::call_do_turn (this=<optimized out>, act=act@entry=0x5555583e4338, you=you@entry=0x5555583e3c70) at src/activity_type.cpp:160 #5 0x00005555566d3a1c in player_activity::do_turn (this=0x5555583e4338, you=...) at src/player_activity.cpp:320 #6 0x0000555555dcef82 in do_turn () at src/do_turn.cpp:592 #7 0x00005555557a1217 in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:873 ```
- Loading branch information