summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-31 17:31:54 +0000
committerrubidium <rubidium@openttd.org>2007-08-31 17:31:54 +0000
commit1b9ea5468e9208075879c9e2dbb88f4095f85f41 (patch)
tree74a83da227317dcff11a372cbc394022b06be45e /src
parent7f21de5ea92bc27492330bb6b06528310123653d (diff)
downloadopenttd-1b9ea5468e9208075879c9e2dbb88f4095f85f41.tar.xz
(svn r11019) -Fix [FS#1176]: Vehicles in a group must always have the same type when adding new vehicles to a group. Patch by SmatZ.
Diffstat (limited to 'src')
-rw-r--r--src/group_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index f27473640..7942d406e 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -216,12 +216,13 @@ CommandCost CmdAddVehicleGroup(TileIndex tile, uint32 flags, uint32 p1, uint32 p
if (!IsValidVehicleID(p2) || (!IsValidGroupID(new_g) && !IsDefaultGroupID(new_g))) return CMD_ERROR;
+ Vehicle *v = GetVehicle(p2);
+
if (IsValidGroupID(new_g)) {
Group *g = GetGroup(new_g);
- if (g->owner != _current_player) return CMD_ERROR;
+ if (g->owner != _current_player || g->vehicle_type != v->type) return CMD_ERROR;
}
- Vehicle *v = GetVehicle(p2);
if (v->owner != _current_player || !v->IsPrimaryVehicle()) return CMD_ERROR;
if (flags & DC_EXEC) {