File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/openvic-simulation/country Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1939,18 +1939,22 @@ void CountryInstance::country_tick_before_map(
19391939 const fixed_point_t projected_military_spending_copy = projected_military_spending.get_untracked ();
19401940 const fixed_point_t projected_social_spending_copy = projected_social_spending.get_untracked ();
19411941 const fixed_point_t projected_import_subsidies_copy = projected_import_subsidies.get_untracked ();
1942- if (projected_spending.get_untracked () <= available_funds) {
1942+ // excluding national stockpile
1943+ const fixed_point_t projected_total_spending = projected_spending.get_untracked ();
1944+ if (projected_total_spending <= available_funds) {
19431945 actual_administration_budget = projected_administration_spending_copy;
19441946 actual_education_budget = projected_education_spending_copy;
19451947 actual_military_budget = projected_military_spending_copy;
19461948 actual_social_budget = projected_social_spending_copy;
19471949 actual_import_subsidies_budget = projected_import_subsidies_copy;
1950+ available_funds -= projected_total_spending;
19481951 } else {
19491952 // TODO try take loan (callback?)
19501953 // update available_funds with loan
19511954
19521955 if (available_funds < projected_education_spending_copy) {
19531956 actual_education_budget = available_funds;
1957+ available_funds = 0 ;
19541958 actual_administration_budget = 0 ;
19551959 actual_military_budget = 0 ;
19561960 actual_social_budget = 0 ;
You can’t perform that action at this time.
0 commit comments