(svn r21415) -Codechange: limit station/waypoint name by amount of characters, not bytes

This commit is contained in:
rubidium
2010-12-05 22:25:36 +00:00
parent eafc316342
commit 7267a4de2c
6 changed files with 7 additions and 7 deletions

View File

@@ -38,7 +38,7 @@
{
EnforcePrecondition(false, IsValidBaseStation(station_id));
EnforcePrecondition(false, !::StrEmpty(name));
EnforcePreconditionCustomError(false, ::strlen(name) < MAX_LENGTH_STATION_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG);
EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_STATION_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG);
return AIObject::DoCommand(0, station_id, 0, ::Station::IsValidID(station_id) ? CMD_RENAME_STATION : CMD_RENAME_WAYPOINT, name);
}