diff options
author | Yexo <yexo@openttd.org> | 2009-01-20 16:49:10 +0000 |
---|---|---|
committer | Yexo <yexo@openttd.org> | 2009-01-20 16:49:10 +0000 |
commit | 3d35b3c2cc8b227d0cc2df61b4e8dbd70b6a78f1 (patch) | |
tree | 09d1d76f4f48c9a1a82dc292ae48bd8ffb432849 /src/ai/ai_info.cpp | |
parent | 49c5c7134807bb2d975a85f974523b699169ef6d (diff) | |
download | openttd-3d35b3c2cc8b227d0cc2df61b4e8dbd70b6a78f1.tar.xz |
(svn r15175) -Feature: Add the option to select the AIs to start in a new game and configure them via the gui.
Diffstat (limited to 'src/ai/ai_info.cpp')
-rw-r--r-- | src/ai/ai_info.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 60503f7dd..4c70e2ab5 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -17,6 +17,20 @@ #include "../settings_type.h" #include "../openttd.h" +AIConfigItem _start_date_config = { + "start_date", + "The amount of days after the start of the last AI, this AI will start (give or take).", + AI::START_NEXT_MIN, + AI::START_NEXT_MAX, + AI::START_NEXT_MEDIUM, + AI::START_NEXT_EASY, + AI::START_NEXT_MEDIUM, + AI::START_NEXT_HARD, + AI::START_NEXT_DEVIATION, + 30, + AICONFIG_NONE +}; + AIFileInfo::~AIFileInfo() { this->engine->ReleaseObject(this->SQ_instance); @@ -160,18 +174,9 @@ void AIFileInfo::CheckMethods(SQInteger *res, const char *name) SQInteger res = AIFileInfo::Constructor(vm, info, false); if (res != 0) return res; - AIConfigItem config; - config.name = strdup("start_date"); - 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; - config.medium_value = AI::START_NEXT_MEDIUM; - 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; + AIConfigItem config = _start_date_config; + config.name = strdup(config.name); + config.description = strdup(config.description); info->config_list.push_back(config); /* Check if we have settings */ |