diff options
author | rubidium <rubidium@openttd.org> | 2010-01-18 15:41:38 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-18 15:41:38 +0000 |
commit | b1bd1067032c51a8d88818488c924c82a8678454 (patch) | |
tree | baffff9722b0568418812cc9eff052edae02f715 /src/ai/ai_instance.cpp | |
parent | a39a446e8faf99568eb8924535fd0034db00bb8e (diff) | |
download | openttd-b1bd1067032c51a8d88818488c924c82a8678454.tar.xz |
(svn r18862) -Fix [FS#3544]: don't pass AI strings through iconv
Diffstat (limited to 'src/ai/ai_instance.cpp')
-rw-r--r-- | src/ai/ai_instance.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index d321214b0..95250fd6c 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -90,7 +90,7 @@ AIStorage::~AIStorage() static void PrintFunc(bool error_msg, const SQChar *message) { /* Convert to OpenTTD internal capable string */ - AIController::Print(error_msg, FS2OTTD(message)); + AIController::Print(error_msg, SQ2OTTD(message)); } AIInstance::AIInstance(AIInfo *info) : @@ -493,9 +493,9 @@ enum { } const SQChar *res; sq_getstring(vm, index, &res); - /* @bug if a string longer than 512 characters is given to FS2OTTD, the + /* @bug if a string longer than 512 characters is given to SQ2OTTD, the * internal buffer overflows. */ - const char *buf = FS2OTTD(res); + const char *buf = SQ2OTTD(res); size_t len = strlen(buf) + 1; if (len >= 255) { AILog::Error("Maximum string length is 254 chars. No data saved."); @@ -673,7 +673,7 @@ void AIInstance::Save() SlObject(NULL, _ai_byte); static char buf[256]; SlArray(buf, _ai_sl_byte, SLE_CHAR); - if (vm != NULL) sq_pushstring(vm, OTTD2FS(buf), -1); + if (vm != NULL) sq_pushstring(vm, OTTD2SQ(buf), -1); return true; } @@ -760,7 +760,7 @@ bool AIInstance::CallLoad() /* Go to the instance-root */ sq_pushobject(vm, *this->instance); /* Find the function-name inside the script */ - sq_pushstring(vm, OTTD2FS("Load"), -1); + sq_pushstring(vm, OTTD2SQ("Load"), -1); /* Change the "Load" string in a function pointer */ sq_get(vm, -2); /* Push the main instance as "this" object */ |