summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-08-20 10:23:39 +0000
committerrubidium <rubidium@openttd.org>2009-08-20 10:23:39 +0000
commit7fb95e2c2b2f84ecf9b5d5d2f02b147d1ad7cb3d (patch)
treefeb24d4a4f522305f7df61aaf26c499eb38c6b6c /src/ai
parent0188ebad5649d4c698245a2fef9039e6155b5f22 (diff)
downloadopenttd-7fb95e2c2b2f84ecf9b5d5d2f02b147d1ad7cb3d.tar.xz
(svn r17228) -Codechange: some coding style fixes
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_info.cpp2
-rw-r--r--src/ai/api/ai_abstractlist.cpp14
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp
index 22e2dcded..7ec0de826 100644
--- a/src/ai/ai_info.cpp
+++ b/src/ai/ai_info.cpp
@@ -198,7 +198,7 @@ SQInteger AIInfo::AddSetting(HSQUIRRELVM vm)
if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR;
config.hard_value = res;
items |= 0x040;
- } else if (strcmp(key, "random_deviation") == 0) {
+ } else if (strcmp(key, "random_deviation") == 0) {
SQInteger res;
if (SQ_FAILED(sq_getinteger(vm, -1, &res))) return SQ_ERROR;
config.random_deviation = res;
diff --git a/src/ai/api/ai_abstractlist.cpp b/src/ai/api/ai_abstractlist.cpp
index b1b9d098d..6cff54dc9 100644
--- a/src/ai/api/ai_abstractlist.cpp
+++ b/src/ai/api/ai_abstractlist.cpp
@@ -489,13 +489,19 @@ void AIAbstractList::Sort(SorterType sorter, bool ascending)
delete this->sorter;
switch (sorter) {
case SORT_BY_ITEM:
- if (ascending) this->sorter = new AIAbstractListSorterItemAscending(this);
- else this->sorter = new AIAbstractListSorterItemDescending(this);
+ if (ascending) {
+ this->sorter = new AIAbstractListSorterItemAscending(this);
+ } else {
+ this->sorter = new AIAbstractListSorterItemDescending(this);
+ }
break;
case SORT_BY_VALUE:
- if (ascending) this->sorter = new AIAbstractListSorterValueAscending(this);
- else this->sorter = new AIAbstractListSorterValueDescending(this);
+ if (ascending) {
+ this->sorter = new AIAbstractListSorterValueAscending(this);
+ } else {
+ this->sorter = new AIAbstractListSorterValueDescending(this);
+ }
break;
default: