From cb1a79175ec03c7835beceeb3c84661b5a9634a9 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Fri, 24 Jan 2020 22:32:48 -0500 Subject: [PATCH] Initialize weather in tests 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. --- tests/test_main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 99c2dbc2c68af..dd6134cb879c3 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -146,6 +146,8 @@ static void init_global_game_state( const std::vector &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