summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-02-08 01:51:48 +0000
committerrubidium <rubidium@openttd.org>2009-02-08 01:51:48 +0000
commite1b1fd18b538e7cbe9b8c5b757b683c4a79f4637 (patch)
tree90b4e755d074b6d4d949c4938eb3d5177c238609 /src/ai/api
parent8bd5f10a2c833b51380ef3f0326071b1de3a8f0d (diff)
downloadopenttd-e1b1fd18b538e7cbe9b8c5b757b683c4a79f4637.tar.xz
(svn r15406) -Fix: make Valuate actually cost a few opcodes to not make it a single opcode method of doing lots of the same thing. This should resolve most of the hiccups caused by AIs.
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_abstractlist.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ai/api/ai_abstractlist.cpp b/src/ai/api/ai_abstractlist.cpp
index 9357f39c5..5fa0a1b23 100644
--- a/src/ai/api/ai_abstractlist.cpp
+++ b/src/ai/api/ai_abstractlist.cpp
@@ -6,6 +6,7 @@
#include "ai_abstractlist.hpp"
#include "../../debug.h"
#include "../../core/alloc_func.hpp"
+#include "../../script/squirrel.hpp"
/**
* Base class for any AIAbstractList sorter.
@@ -818,6 +819,8 @@ SQInteger AIAbstractList::Valuate(HSQUIRRELVM vm) {
(*iter).second = (int32)value;
this->buckets[(int32)value].insert((*iter).first);
+
+ Squirrel::DecreaseOps(vm, 5);
}
sq_release(vm, &obj_func);