Author: mordante
Date: Wed Aug 22 21:22:26 2007
New Revision: 19735
URL: http://svn.gna.org/viewcvs/wesnoth?rev=19735&view=rev
Log:
Allow unlimited turns also to be loaded properly.
Modified:
trunk/src/settings.cpp
Modified: trunk/src/settings.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/settings.cpp?rev=19735&r1=19734&r2=19735&view=diff
==============================================================================
--- trunk/src/settings.cpp (original)
+++ trunk/src/settings.cpp Wed Aug 22 21:22:26 2007
@@ -22,11 +22,17 @@
#include "serialization/string_utils.hpp"
#include "util.hpp"
-
namespace settings {
int get_turns(const std::string& value)
{
+ // Special case, -1 is also allowed, which are unlimited turns
+ int val = lexical_cast_default<int>(value);
+
+ if(val == -1) {
+ return 100;
+ }
+
return lexical_cast_in_range<int>(value, 50, 20, 100);
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits