Skip to content

Commit

Permalink
Fix tileset being loaded in test application.
Browse files Browse the repository at this point in the history
If the SDL initialization has not been run, the `tilecontext` pointer has not been set, so we skip loading the tileset.
  • Loading branch information
BevapDin committed Dec 11, 2017
1 parent 18e472a commit 17d3f46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1567,8 +1567,9 @@ void catacurses::init_interface()
//newwin calls `new WINDOW`, and that will throw, but not return nullptr.
}

// This is supposed to be called from init.cpp, and only from there.
void load_tileset() {
if( !use_tiles ) {
if( !tilecontext || !use_tiles ) {
return;
}
tilecontext->load_tileset( get_option<std::string>( "TILES" ) );
Expand Down

0 comments on commit 17d3f46

Please sign in to comment.