static */
| 247 | } |
| 248 | |
| 249 | /* static */ bool ScriptVehicle::SetName(VehicleID vehicle_id, Text *name) |
| 250 | { |
| 251 | ScriptObjectRef counter(name); |
| 252 | |
| 253 | EnforceCompanyModeValid(false); |
| 254 | EnforcePrecondition(false, IsPrimaryVehicle(vehicle_id)); |
| 255 | EnforcePrecondition(false, name != nullptr); |
| 256 | const std::string &text = name->GetDecodedText(); |
| 257 | EnforcePreconditionEncodedText(false, text); |
| 258 | EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_VEHICLE_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); |
| 259 | |
| 260 | return ScriptObject::Command<CMD_RENAME_VEHICLE>::Do(vehicle_id, text); |
| 261 | } |
| 262 | |
| 263 | /* static */ TileIndex ScriptVehicle::GetLocation(VehicleID vehicle_id) |
| 264 | { |
nothing calls this directly
no test coverage detected