From 68f969282e646b3fde7797a91beb3e38701564a6 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 3 Oct 2011 17:21:41 +0000 Subject: (svn r22978) -Codechange: Replace IncreaseGroupNumVehicle() and DecreaseGroupNumVehicle() with GroupStatistics::CountVehicle(). --- src/train_cmd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 55465d23d..86099507d 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1245,13 +1245,13 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u /* We are going to be moved to a different train, and * we were the front engine of the original train. */ if (dst_head != NULL && dst_head != src && (src_head == NULL || !src_head->IsFrontEngine())) { - DecreaseGroupNumVehicle(src->group_id); + GroupStatistics::CountVehicle(src, -1); } /* The front engine is going to be moved later in the * current train, and it will not be a train anymore. */ if (dst_head == NULL && !src_head->IsFrontEngine()) { - DecreaseGroupNumVehicle(src->group_id); + GroupStatistics::CountVehicle(src, -1); } /* Delete orders, group stuff and the unit number as we're not the @@ -1264,7 +1264,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u /* We were a front engine and we are becoming one for a different train. * Increase the group counter accordingly. */ if (original_src_head == src && dst_head == src) { - IncreaseGroupNumVehicle(src->group_id); + GroupStatistics::CountVehicle(src, 1); } /* We weren't a front engine but are becoming one. So @@ -1354,7 +1354,7 @@ CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, uint16 data, uint3 /* Copy other important data from the front engine */ new_head->CopyVehicleConfigAndStatistics(first); - IncreaseGroupNumVehicle(new_head->group_id); + GroupStatistics::CountVehicle(new_head, 1); /* If we deleted a window then open a new one for the 'new' train */ if (IsLocalCompany() && w != NULL) ShowVehicleViewWindow(new_head); -- cgit v1.2.3-54-g00ecf