1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-01 10:59:12 +00:00

(svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is

no limit to the amount of names.
-Fix: NewGRF engines could not be renamed.
This commit is contained in:
2008-01-12 19:58:06 +00:00
parent a222fe2e86
commit ab8382c0db
38 changed files with 250 additions and 298 deletions

View File

@@ -707,8 +707,6 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x5D: return GB(ClampToI32(v->value), 8, 24);
case 0x5E: return GB(ClampToI32(v->value), 16, 16);
case 0x5F: return GB(ClampToI32(v->value), 24, 8);
case 0x60: return v->string_id;
case 0x61: return GB(v->string_id, 8, 8);
case 0x72: return v->cargo_subtype;
case 0x7A: return v->random_bits;
case 0x7B: return v->waiting_triggers;
@@ -1041,27 +1039,6 @@ void TriggerVehicle(Vehicle *v, VehicleTrigger trigger)
DoTriggerVehicle(v, trigger, 0, true);
}
StringID _engine_custom_names[TOTAL_NUM_ENGINES];
void SetCustomEngineName(EngineID engine, StringID name)
{
assert(engine < lengthof(_engine_custom_names));
_engine_custom_names[engine] = name;
}
void UnloadCustomEngineNames()
{
EngineID i;
for (i = 0; i < TOTAL_NUM_ENGINES; i++) {
_engine_custom_names[i] = 0;
}
}
StringID GetCustomEngineName(EngineID engine)
{
return _engine_custom_names[engine] == 0 ? _engine_name_strings[engine] : _engine_custom_names[engine];
}
/* Functions for changing the order of vehicle purchase lists
* This is currently only implemented for rail vehicles. */
static EngineID _engine_list_order[NUM_TRAIN_ENGINES];