diff options
author | rubidium <rubidium@openttd.org> | 2010-12-05 22:25:08 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-12-05 22:25:08 +0000 |
commit | 6e69b943d685c3b485d415d4fce53af28f0eba85 (patch) | |
tree | 4fdd482d8d916951c9b34edceb4127f7bf6871ed /src/ai/api | |
parent | cf61c2f11fbffe20749382feb8fe03d238a2888d (diff) | |
download | openttd-6e69b943d685c3b485d415d4fce53af28f0eba85.tar.xz |
(svn r21413) -Codechange: limit sign name by amount of characters, not bytes
Diffstat (limited to 'src/ai/api')
-rw-r--r-- | src/ai/api/ai_sign.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/api/ai_sign.cpp b/src/ai/api/ai_sign.cpp index ce36b1848..df16af0b7 100644 --- a/src/ai/api/ai_sign.cpp +++ b/src/ai/api/ai_sign.cpp @@ -30,7 +30,7 @@ { EnforcePrecondition(false, IsValidSign(sign_id)); EnforcePrecondition(false, !::StrEmpty(name)); - EnforcePreconditionCustomError(false, ::strlen(name) < MAX_LENGTH_SIGN_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG); + EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_SIGN_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG); return AIObject::DoCommand(0, sign_id, 0, CMD_RENAME_SIGN, name); } @@ -66,7 +66,7 @@ { EnforcePrecondition(INVALID_SIGN, ::IsValidTile(location)); EnforcePrecondition(INVALID_SIGN, !::StrEmpty(text)); - EnforcePreconditionCustomError(false, ::strlen(text) < MAX_LENGTH_SIGN_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG); + EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG); if (!AIObject::DoCommand(location, 0, 0, CMD_PLACE_SIGN, text, &AIInstance::DoCommandReturnSignID)) return INVALID_SIGN; |