summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-05 22:24:50 +0000
committerrubidium <rubidium@openttd.org>2010-12-05 22:24:50 +0000
commitcf61c2f11fbffe20749382feb8fe03d238a2888d (patch)
treef6a5ff6ee367f3a62f59d1e7099aeafcfb665b5f /src/ai/api
parent768da4b48f8c70177cb5dfc77a30a23a98a3ae05 (diff)
downloadopenttd-cf61c2f11fbffe20749382feb8fe03d238a2888d.tar.xz
(svn r21412) -Codechange: limit company name by amount of characters, not bytes
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_company.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/api/ai_company.cpp b/src/ai/api/ai_company.cpp
index e11b2bb4b..03a642609 100644
--- a/src/ai/api/ai_company.cpp
+++ b/src/ai/api/ai_company.cpp
@@ -38,7 +38,7 @@
/* static */ bool AICompany::SetName(const char *name)
{
EnforcePrecondition(false, !::StrEmpty(name));
- EnforcePreconditionCustomError(false, ::strlen(name) < MAX_LENGTH_COMPANY_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG);
+ EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_COMPANY_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG);
return AIObject::DoCommand(0, 0, 0, CMD_RENAME_COMPANY, name);
}