Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixbug 22611: don't close the program if we can't find button image
If the main button image could not be loaded, the previous code would throw an exception of an obscure type "error". It appears that this was not caught anywhere except the main function in wesnoth.cpp and so the program would close immediately. I first tried to go into the gui initialization and construct buttons in try catch blocks, skipping ones that have problems, but rather than being able to proceed, this just causes a segfault because other parts of the code assume that all buttons have been constructed successfully. This means that not finding the image is necessarily a fatal error. My fix for the problem is, instead of throwing error, we throw the more standard "game::game_error". The new behavior is, if you try to load a theme with nonexistant images, then a black screen will appear with a dialog "error initializing button images! filename: buttons/dontexist.png" The game then returns to the title screen. Conflicts: src/widgets/button.cpp (just the #include reorder)
- Loading branch information