summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-13 18:26:58 +0000
committertruebrain <truebrain@openttd.org>2009-01-13 18:26:58 +0000
commitec4bdfe611af31bc9f54d103d30c4c082174358e (patch)
tree813a9cace0e5322ca56a53c8c30b022243bb0d9a /src
parentafb94c252df09f2f86186fbf6dcdf01ea2d55b12 (diff)
downloadopenttd-ec4bdfe611af31bc9f54d103d30c4c082174358e.tar.xz
(svn r15068) -Add [NoAI]: introducing 'step_size' for AIConfig, for future AIGUI (Yexo)
Diffstat (limited to 'src')
-rw-r--r--src/ai/ai_info.cpp8
-rw-r--r--src/ai/ai_info.hpp1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp
index c67059f20..b2c653826 100644
--- a/src/ai/ai_info.cpp
+++ b/src/ai/ai_info.cpp
@@ -153,7 +153,7 @@ void AIFileInfo::CheckMethods(SQInteger *res, const char *name)
AIConfigItem config;
config.name = strdup("start_date");
- config.description = strdup("The amount of months after the start of the last AI, this AI will start (give or take).");
+ config.description = strdup("The amount of days after the start of the last AI, this AI will start (give or take).");
config.min_value = AI::START_NEXT_MIN;
config.max_value = AI::START_NEXT_MAX;
config.easy_value = AI::START_NEXT_EASY;
@@ -161,6 +161,7 @@ void AIFileInfo::CheckMethods(SQInteger *res, const char *name)
config.hard_value = AI::START_NEXT_HARD;
config.custom_value = AI::START_NEXT_MEDIUM;
config.random_deviation = AI::START_NEXT_DEVIATION;
+ config.step_size = 30;
config.flags = AICONFIG_NONE;
info->config_list.push_back(config);
@@ -208,6 +209,7 @@ SQInteger AIInfo::AddSetting(HSQUIRRELVM vm)
AIConfigItem config;
memset(&config, 0, sizeof(config));
config.max_value = 1;
+ config.step_size = 1;
uint items = 0;
/* Read the table, and find all properties we care about */
@@ -267,6 +269,10 @@ SQInteger AIInfo::AddSetting(HSQUIRRELVM vm)
sq_getinteger(vm, -1, &res);
config.custom_value = res;
items |= 0x080;
+ } else if (strcmp(key, "step_size") == 0) {
+ SQInteger res;
+ sq_getinteger(vm, -1, &res);
+ config.step_size = res;
} else if (strcmp(key, "flags") == 0) {
SQInteger res;
sq_getinteger(vm, -1, &res);
diff --git a/src/ai/ai_info.hpp b/src/ai/ai_info.hpp
index ce48a6f35..71691ae3a 100644
--- a/src/ai/ai_info.hpp
+++ b/src/ai/ai_info.hpp
@@ -24,6 +24,7 @@ struct AIConfigItem {
int medium_value; //!< The default value on medium difficulty setting.
int hard_value; //!< The default value on hard difficulty setting.
int random_deviation; //!< The maximum random deviation from the default value.
+ int step_size; //!< The step size in the gui.
AIConfigFlags flags; //!< Flags for the configuration setting.
};