(svn r13761) -Codechange: Remove dependency on rail for altering purchase list position (mostly function renaming)

This commit is contained in:
peter1138 2008-07-20 21:23:28 +00:00
parent 00e052ad39
commit e6a1f1c012
3 changed files with 7 additions and 7 deletions

View File

@ -584,7 +584,7 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
} break;
case 0x1A: // Alter purchase list sort order
AlterRailVehListOrder(e->index, grf_load_byte(&buf));
AlterVehicleListOrder(e->index, grf_load_byte(&buf));
break;
case 0x1B: // Powered wagons power bonus
@ -6002,7 +6002,7 @@ static void AfterLoadGRFs()
InitGRFTownGeneratorNames();
/* Run all queued vehicle list order changes */
CommitRailVehListOrderChanges();
CommitVehicleListOrderChanges();
/* Load old shore sprites in new position, if they were replaced by ActionA */
ActivateOldShore();

View File

@ -1093,7 +1093,7 @@ struct ListOrderChange {
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 */
ListOrderChange loc;
@ -1102,7 +1102,7 @@ void AlterRailVehListOrder(EngineID engine, EngineID target)
_list_order_changes.push_back(loc);
}
void CommitRailVehListOrderChanges()
void CommitVehicleListOrderChanges()
{
/* List position to Engine map */
typedef std::map<uint16, Engine*> ListPositionMap;
@ -1120,7 +1120,7 @@ void CommitRailVehListOrderChanges()
/* Populate map with current list positions */
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 (e->internal_id == target) target_e = e;
lptr_map[e->list_position] = e;

View File

@ -56,8 +56,8 @@ void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger);
void UnloadWagonOverrides(Engine *e);
uint ListPositionOfEngine(EngineID engine);
void AlterRailVehListOrder(EngineID engine, EngineID target);
void CommitRailVehListOrderChanges();
void AlterVehicleListOrder(EngineID engine, EngineID target);
void CommitVehicleListOrderChanges();
EngineID GetNewEngineID(const GRFFile *file, VehicleType type, uint16 internal_id);