Clearing a blueprint item that doesn't have 'item_to_clear' set, crashes the game.
Expected result:
Any of the following:
- Display a message stating that the blueprint cannot be cleared.
- Clear the blueprint without using an item.
- Throw an error stating that 'item_to_clear' is not set while loading the mod
Reproduction scenario:
- Install the attached mod.
- Start a new game (the mod will provide some additional starting items, including the 'broken blueprint' item).
- Place an object (for example, a wooden-chest or burner-inserter).
- Use the 'broken blueprint' item (signal B icon) to create a blueprint.
- Try to clear the blueprint by right-clicking it. This crashes the game.
Code: Select all
#0 0x7fedc62282f0 in ?? at ??:0
#1 0xdfed68 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) at ??:?
#2 0x52622c in LocalisedString::LocalisedString(LocalisedString const&) at /usr/include/c++/5/bits/stl_vector.h:655
#3 0x547a59 in std::vector<LocalisedString, std::allocator<LocalisedString> >::vector(std::vector<LocalisedString, std::allocator<LocalisedString> > const&) at /usr/include/c++/5/bits/stl_vector.h:320
#4 0x547cbe in LocalisedString::LocalisedString(LocalisedString const&) at /tmp/factorio-muYlK6/src/Util/LocalisedString.hpp:14
#5 0x99c212 in void std::vector<LocalisedString, std::allocator<LocalisedString> >::_M_emplace_back_aux<LocalisedString const&>(LocalisedString const&) at /usr/include/c++/5/ext/new_allocator.h:120
#6 0x78d329 in _S_construct<LocalisedString, const LocalisedString&> at /usr/include/c++/5/bits/alloc_traits.h:256
#7 0x6d427c in construct<LocalisedString, const LocalisedString&> at /usr/include/c++/5/bits/alloc_traits.h:402
#8 0xa46ff5 in _M_emplace_back_aux<const LocalisedString&> at /usr/include/c++/5/bits/vector.tcc:416
#9 0x6d3488 in LocalisedString::LocalisedString(std::string const&, LocalisedString const&) at /tmp/factorio-muYlK6/src/Util/LocalisedString.cpp:122
#10 0x7523b4 in GameActionHandler::clearBlueprint(InputAction const&, Controller*) at /tmp/factorio-muYlK6/src/GameActionHandler.cpp:739 (discriminator 4)
#11 0xd5851f in GameActionHandler::actionPerformed(InputAction const&) at /tmp/factorio-muYlK6/src/GameActionHandler.cpp:206 (discriminator 4)
#12 0x7fedc7d876aa in InputHandler::flushActions(bool) at /tmp/factorio-muYlK6/src/Input/InputHandler.cpp:41
#13 0x7fedc62f9e9d in flushActions at /tmp/factorio-muYlK6/src/Input/InputHandler.cpp:34
Specify an unobtainable dummy item as 'item_to_clear' and use 'to know that it's impossible' as the item's name. When trying to clear such a blueprint it gives the message: "You need to know that it's impossible to clear this blueprint.".