(svn r21416) -Codechange: limit vehicle name by amount of characters, not bytes

This commit is contained in:
rubidium
2010-12-05 22:25:49 +00:00
parent 44d1c55347
commit ea68039718
4 changed files with 4 additions and 4 deletions

View File

@@ -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);
}