summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-05 22:25:49 +0000
committerrubidium <rubidium@openttd.org>2010-12-05 22:25:49 +0000
commitea6803971879f9c35fd2695d3817b54b87fb6269 (patch)
tree4f18386494a5fc93a119ad76f9ed8d7d3ca71c15 /src/ai
parent44d1c5534757a284b528dfe30ba227675234b4e4 (diff)
downloadopenttd-ea6803971879f9c35fd2695d3817b54b87fb6269.tar.xz
(svn r21416) -Codechange: limit vehicle name by amount of characters, not bytes
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp
index bb4f756af..d7d066c7b 100644
--- a/src/ai/api/ai_vehicle.cpp
+++ b/src/ai/api/ai_vehicle.cpp
@@ -208,7 +208,7 @@
{
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
EnforcePrecondition(false, !::StrEmpty(name));
- EnforcePreconditionCustomError(false, ::strlen(name) < MAX_LENGTH_VEHICLE_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG);
+ EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_VEHICLE_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG);
return AIObject::DoCommand(0, vehicle_id, 0, CMD_RENAME_VEHICLE, name);
}