mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r13761) -Codechange: Remove dependency on rail for altering purchase list position (mostly function renaming)
This commit is contained in:
parent
00e052ad39
commit
e6a1f1c012
|
@ -584,7 +584,7 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 0x1A: // Alter purchase list sort order
|
case 0x1A: // Alter purchase list sort order
|
||||||
AlterRailVehListOrder(e->index, grf_load_byte(&buf));
|
AlterVehicleListOrder(e->index, grf_load_byte(&buf));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x1B: // Powered wagons power bonus
|
case 0x1B: // Powered wagons power bonus
|
||||||
|
@ -6002,7 +6002,7 @@ static void AfterLoadGRFs()
|
||||||
InitGRFTownGeneratorNames();
|
InitGRFTownGeneratorNames();
|
||||||
|
|
||||||
/* Run all queued vehicle list order changes */
|
/* Run all queued vehicle list order changes */
|
||||||
CommitRailVehListOrderChanges();
|
CommitVehicleListOrderChanges();
|
||||||
|
|
||||||
/* Load old shore sprites in new position, if they were replaced by ActionA */
|
/* Load old shore sprites in new position, if they were replaced by ActionA */
|
||||||
ActivateOldShore();
|
ActivateOldShore();
|
||||||
|
|
|
@ -1093,7 +1093,7 @@ struct ListOrderChange {
|
||||||
|
|
||||||
static std::list<ListOrderChange> _list_order_changes;
|
static std::list<ListOrderChange> _list_order_changes;
|
||||||
|
|
||||||
void AlterRailVehListOrder(EngineID engine, EngineID target)
|
void AlterVehicleListOrder(EngineID engine, EngineID target)
|
||||||
{
|
{
|
||||||
/* Add the list order change to a queue */
|
/* Add the list order change to a queue */
|
||||||
ListOrderChange loc;
|
ListOrderChange loc;
|
||||||
|
@ -1102,7 +1102,7 @@ void AlterRailVehListOrder(EngineID engine, EngineID target)
|
||||||
_list_order_changes.push_back(loc);
|
_list_order_changes.push_back(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommitRailVehListOrderChanges()
|
void CommitVehicleListOrderChanges()
|
||||||
{
|
{
|
||||||
/* List position to Engine map */
|
/* List position to Engine map */
|
||||||
typedef std::map<uint16, Engine*> ListPositionMap;
|
typedef std::map<uint16, Engine*> ListPositionMap;
|
||||||
|
@ -1120,7 +1120,7 @@ void CommitRailVehListOrderChanges()
|
||||||
|
|
||||||
/* Populate map with current list positions */
|
/* Populate map with current list positions */
|
||||||
Engine *e;
|
Engine *e;
|
||||||
FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) {
|
FOR_ALL_ENGINES_OF_TYPE(e, source_e->type) {
|
||||||
if (!_settings_game.vehicle.dynamic_engines || e->grffile == source_e->grffile) {
|
if (!_settings_game.vehicle.dynamic_engines || e->grffile == source_e->grffile) {
|
||||||
if (e->internal_id == target) target_e = e;
|
if (e->internal_id == target) target_e = e;
|
||||||
lptr_map[e->list_position] = e;
|
lptr_map[e->list_position] = e;
|
||||||
|
|
|
@ -56,8 +56,8 @@ void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger);
|
||||||
void UnloadWagonOverrides(Engine *e);
|
void UnloadWagonOverrides(Engine *e);
|
||||||
|
|
||||||
uint ListPositionOfEngine(EngineID engine);
|
uint ListPositionOfEngine(EngineID engine);
|
||||||
void AlterRailVehListOrder(EngineID engine, EngineID target);
|
void AlterVehicleListOrder(EngineID engine, EngineID target);
|
||||||
void CommitRailVehListOrderChanges();
|
void CommitVehicleListOrderChanges();
|
||||||
|
|
||||||
EngineID GetNewEngineID(const GRFFile *file, VehicleType type, uint16 internal_id);
|
EngineID GetNewEngineID(const GRFFile *file, VehicleType type, uint16 internal_id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue