(svn r10314) -Codechange: Refer to vehicle names by index

This commit is contained in:
2007-06-24 22:42:11 +00:00
parent ce91598e3c
commit fc7418d19d
13 changed files with 43 additions and 36 deletions

View File

@@ -17,6 +17,7 @@
#include "aircraft.h"
#include "cargotype.h"
#include "group.h"
#include "strings.h"
/*
@@ -241,7 +242,8 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
if (!IsCustomName(old_v->string_id)) {
vehicle_name[0] = '\0';
} else {
GetName(vehicle_name, old_v->string_id & 0x7FF, lastof(vehicle_name));
SetDParam(0, old_v->index);
GetString(vehicle_name, STR_VEHICLE_NAME, lastof(vehicle_name));
}
} else { // flags & DC_EXEC not set
CommandCost tmp_move;