From c57467034ebac8798c2c1fea04c461bde7ad5ef9 Mon Sep 17 00:00:00 2001 From: Iurii Chernyi Date: Tue, 29 Mar 2011 21:50:13 +0000 Subject: [PATCH] Patch #2610 by Zaroth: default turn limit to -1 when reading WML, ...plus changes for story-only campaign scenarios --- changelog | 2 ++ .../Delfadors_Memoirs/scenarios/16_Dark_Sky_Over_Weldyn.cfg | 1 + data/campaigns/Delfadors_Memoirs/scenarios/23_Epilogue.cfg | 1 + data/campaigns/Legend_of_Wesmere/scenarios/12_Revelations.cfg | 1 + data/campaigns/Legend_of_Wesmere/scenarios/15_The_Treaty.cfg | 1 + .../Legend_of_Wesmere/scenarios/18_Hour_of_Glory.cfg | 1 + .../Legend_of_Wesmere/scenarios/20_Council_Ruling.cfg | 1 + data/campaigns/Legend_of_Wesmere/scenarios/24_Epilogue.cfg | 1 + .../The_Rise_Of_Wesnoth/scenarios/07_Return_to_Oldwood.cfg | 1 + .../The_Rise_Of_Wesnoth/scenarios/11_Southbay_in_Winter.cfg | 1 + .../The_Rise_Of_Wesnoth/scenarios/18_A_Spy_in_the_Woods.cfg | 1 + data/campaigns/The_Rise_Of_Wesnoth/scenarios/21_The_Plan.cfg | 1 + data/campaigns/The_Rise_Of_Wesnoth/scenarios/23_Epilogue.cfg | 1 + src/playcampaign.cpp | 4 ++-- src/replay_controller.cpp | 2 +- 15 files changed, 17 insertions(+), 3 deletions(-) diff --git a/changelog b/changelog index 041c7c72075..cf01c1c316f 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,8 @@ Version 1.9.5+svn: * Language and i18n: * Updated translations: British English, Galician, Old English + * WML engine: + * Patch #2610: changed default for turns in [scenario] tag to -1 (unlimited) * Miscellaneous and bugfixes: * Changed : replaced all sticky excpetions by lua jailbreak exceptions (fixes bug #17743). diff --git a/data/campaigns/Delfadors_Memoirs/scenarios/16_Dark_Sky_Over_Weldyn.cfg b/data/campaigns/Delfadors_Memoirs/scenarios/16_Dark_Sky_Over_Weldyn.cfg index deeb28971b0..823a8b52766 100644 --- a/data/campaigns/Delfadors_Memoirs/scenarios/16_Dark_Sky_Over_Weldyn.cfg +++ b/data/campaigns/Delfadors_Memoirs/scenarios/16_Dark_Sky_Over_Weldyn.cfg @@ -3,6 +3,7 @@ name= _ "Dark Sky Over Weldyn" id=16_Dark_Sky_Over_Weldyn next_scenario=17_A_New_Ally + turns=1 {NO_MAP_DATA} # Significant plot points: (1) Elves (and, later, others) help buy diff --git a/data/campaigns/Delfadors_Memoirs/scenarios/23_Epilogue.cfg b/data/campaigns/Delfadors_Memoirs/scenarios/23_Epilogue.cfg index 5457d27d436..491aa696c4d 100644 --- a/data/campaigns/Delfadors_Memoirs/scenarios/23_Epilogue.cfg +++ b/data/campaigns/Delfadors_Memoirs/scenarios/23_Epilogue.cfg @@ -3,6 +3,7 @@ name=_ "Epilogue" id=23_Epilogue next_scenario=null + turns=1 {NO_MAP_DATA} {DEFAULT_SCHEDULE} diff --git a/data/campaigns/Legend_of_Wesmere/scenarios/12_Revelations.cfg b/data/campaigns/Legend_of_Wesmere/scenarios/12_Revelations.cfg index 1b14837b203..8f2326358a8 100644 --- a/data/campaigns/Legend_of_Wesmere/scenarios/12_Revelations.cfg +++ b/data/campaigns/Legend_of_Wesmere/scenarios/12_Revelations.cfg @@ -8,6 +8,7 @@ name= _ "Revelations" id=12_Revelations next_scenario=13_News_from_the_Front + turns=1 {NO_MAP_DATA} {SCENARIO_MUSIC the_dangerous_symphony.ogg} diff --git a/data/campaigns/Legend_of_Wesmere/scenarios/15_The_Treaty.cfg b/data/campaigns/Legend_of_Wesmere/scenarios/15_The_Treaty.cfg index 0a96eccec64..868ec51a993 100644 --- a/data/campaigns/Legend_of_Wesmere/scenarios/15_The_Treaty.cfg +++ b/data/campaigns/Legend_of_Wesmere/scenarios/15_The_Treaty.cfg @@ -3,6 +3,7 @@ name= _ "The Treaty" id=15_The_Treaty next_scenario=16_The_Chief_Must_Die + turns=1 {NO_MAP_DATA} {SCENARIO_MUSIC heroes_rite.ogg} diff --git a/data/campaigns/Legend_of_Wesmere/scenarios/18_Hour_of_Glory.cfg b/data/campaigns/Legend_of_Wesmere/scenarios/18_Hour_of_Glory.cfg index 75eb34d8ded..c0277c59519 100644 --- a/data/campaigns/Legend_of_Wesmere/scenarios/18_Hour_of_Glory.cfg +++ b/data/campaigns/Legend_of_Wesmere/scenarios/18_Hour_of_Glory.cfg @@ -3,6 +3,7 @@ name= _ "Hour of Glory" id=18_Hour_of_Glory next_scenario=19_Costly_Revenge + turns=1 {NO_MAP_DATA} {SCENARIO_MUSIC love_theme.ogg} diff --git a/data/campaigns/Legend_of_Wesmere/scenarios/20_Council_Ruling.cfg b/data/campaigns/Legend_of_Wesmere/scenarios/20_Council_Ruling.cfg index 9bc7a96584e..dbcb0a6f406 100644 --- a/data/campaigns/Legend_of_Wesmere/scenarios/20_Council_Ruling.cfg +++ b/data/campaigns/Legend_of_Wesmere/scenarios/20_Council_Ruling.cfg @@ -4,6 +4,7 @@ id=20_Council_Ruling {NO_MAP_DATA} next_scenario=21_Elvish_Assassins + turns=1 {SCENARIO_MUSIC "transience.ogg"} diff --git a/data/campaigns/Legend_of_Wesmere/scenarios/24_Epilogue.cfg b/data/campaigns/Legend_of_Wesmere/scenarios/24_Epilogue.cfg index 487500f2dc0..d8ee18650f4 100644 --- a/data/campaigns/Legend_of_Wesmere/scenarios/24_Epilogue.cfg +++ b/data/campaigns/Legend_of_Wesmere/scenarios/24_Epilogue.cfg @@ -2,6 +2,7 @@ [scenario] name= _ "Epilogue" id=24_Epilogue + turns=1 {NO_MAP_DATA} {SCENARIO_MUSIC elf-land.ogg} diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/07_Return_to_Oldwood.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/07_Return_to_Oldwood.cfg index e1f6ec743c1..e206fa28da2 100644 --- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/07_Return_to_Oldwood.cfg +++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/07_Return_to_Oldwood.cfg @@ -5,6 +5,7 @@ bonus=yes name= _ "Return to Oldwood" map_data="{campaigns/The_Rise_Of_Wesnoth/maps/05_The_Oldwood.map}" + turns=1 {DEFAULT_SCHEDULE} diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/11_Southbay_in_Winter.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/11_Southbay_in_Winter.cfg index 1f1994a0e14..8f963e7c5c0 100644 --- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/11_Southbay_in_Winter.cfg +++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/11_Southbay_in_Winter.cfg @@ -5,6 +5,7 @@ next_scenario=12_A_Final_Spring bonus=yes map_data="{campaigns/The_Rise_Of_Wesnoth/maps/11_Southbay_in_Winter.map}" + turns=1 {DEFAULT_SCHEDULE} diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/18_A_Spy_in_the_Woods.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/18_A_Spy_in_the_Woods.cfg index bb1c3f1b598..608f2722853 100644 --- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/18_A_Spy_in_the_Woods.cfg +++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/18_A_Spy_in_the_Woods.cfg @@ -4,6 +4,7 @@ name= _ "A Spy in the Woods" next_scenario=19_The_Vanguard map_data="{campaigns/The_Rise_Of_Wesnoth/maps/16_The_Kalian.map}" + turns=1 {AFTERNOON} diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/21_The_Plan.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/21_The_Plan.cfg index 6f6e6e70cac..62a7c047671 100644 --- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/21_The_Plan.cfg +++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/21_The_Plan.cfg @@ -4,6 +4,7 @@ name= _ "The Plan" next_scenario=22_The_Rise_of_Wesnoth map_data="{campaigns/The_Rise_Of_Wesnoth/maps/21_The_Plan.map}" + turns=1 {AFTERNOON} diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/23_Epilogue.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/23_Epilogue.cfg index dd647cfd6dd..5fd4eb9c9fd 100644 --- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/23_Epilogue.cfg +++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/23_Epilogue.cfg @@ -4,6 +4,7 @@ name= _ "Epilogue" next_scenario=null map_data="{campaigns/The_Rise_Of_Wesnoth/maps/21_The_Plan.map}" + turns=1 {AFTERNOON} diff --git a/src/playcampaign.cpp b/src/playcampaign.cpp index 4c48bbc216e..ab9c63c5b6b 100644 --- a/src/playcampaign.cpp +++ b/src/playcampaign.cpp @@ -121,7 +121,7 @@ static LEVEL_RESULT playsingle_scenario(const config& game_config, bool skip_replay, end_level_data &end_level) { const int ticks = SDL_GetTicks(); - int num_turns = (*level)["turns"].to_int(); + int num_turns = (*level)["turns"].to_int(-1); LOG_NG << "creating objects... " << (SDL_GetTicks() - ticks) << "\n"; playsingle_controller playcontroller(*level, state_of_game, ticks, num_turns, game_config, disp.video(), skip_replay); @@ -160,7 +160,7 @@ static LEVEL_RESULT playmp_scenario(const config& game_config, io_type_t& io_type, end_level_data &end_level) { const int ticks = SDL_GetTicks(); - int num_turns = (*level)["turns"].to_int(); + int num_turns = (*level)["turns"].to_int(-1); playmp_controller playcontroller(*level, state_of_game, ticks, num_turns, game_config, disp.video(), skip_replay, io_type == IO_SERVER); LEVEL_RESULT res = playcontroller.play_scenario(story, skip_replay); diff --git a/src/replay_controller.cpp b/src/replay_controller.cpp index c7932e6f757..c378064e199 100644 --- a/src/replay_controller.cpp +++ b/src/replay_controller.cpp @@ -39,7 +39,7 @@ LEVEL_RESULT play_replay_level(const config& game_config, { try{ const int ticks = SDL_GetTicks(); - int num_turns = (*level)["turns"].to_int(); + int num_turns = (*level)["turns"].to_int(-1); DBG_NG << "creating objects... " << (SDL_GetTicks() - ticks) << "\n"; replay_controller replaycontroller(*level, state_of_game, ticks, num_turns, game_config, video); DBG_NG << "created objects... " << (SDL_GetTicks() - replaycontroller.get_ticks()) << "\n";