summaryrefslogtreecommitdiff
path: root/src/script/script_info.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-06-01 15:19:59 +0000
committerfrosch <frosch@openttd.org>2012-06-01 15:19:59 +0000
commitbe0b94400d6e7e9136703d60b70b495d84f25108 (patch)
tree45ab8e4c13628c0ec58bd9e061747a005019a9a2 /src/script/script_info.cpp
parentf7c9620271e0ee620fad8fe325d67e59539c08d8 (diff)
downloadopenttd-be0b94400d6e7e9136703d60b70b495d84f25108.tar.xz
(svn r24317) -Feature: Add dropdowns to AI configurations, if all values have labels.
Diffstat (limited to 'src/script/script_info.cpp')
-rw-r--r--src/script/script_info.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/script_info.cpp b/src/script/script_info.cpp
index 779236ebc..b5a83ccb2 100644
--- a/src/script/script_info.cpp
+++ b/src/script/script_info.cpp
@@ -263,6 +263,15 @@ SQInteger ScriptInfo::AddLabels(HSQUIRRELVM vm)
}
sq_pop(vm, 1);
+ /* Check labels for completeness */
+ config->complete_labels = true;
+ for (int value = config->min_value; value <= config->max_value; value++) {
+ if (!config->labels->Contains(value)) {
+ config->complete_labels = false;
+ break;
+ }
+ }
+
return 0;
}