Skip to content

Commit

Permalink
Initialize weather in tests
Browse files Browse the repository at this point in the history
The tests never initialized the state of the weather system, leaving
some uninitialized values which could lead to winds in the billions of
miles per hour.  That in turn led to overflows and UB.

Initialize the weather system appropriately.
  • Loading branch information
jbytheway committed Jan 25, 2020
1 parent f572d0a commit cb1a791
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ static void init_global_game_state( const std::vector<mod_id> &mods,
overmap_buffer.create_custom_overmap( point_zero, empty_specials );

g->m.load( tripoint( g->get_levx(), g->get_levy(), g->get_levz() ), false );

g->weather.update_weather();
}

// Checks if any of the flags are in container, removes them all
Expand Down

0 comments on commit cb1a791

Please sign in to comment.