summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-05-23 14:02:10 +0000
committerpeter1138 <peter1138@openttd.org>2007-05-23 14:02:10 +0000
commitfa72a4ebd11d97551230c82dc19333c17e167a28 (patch)
tree2683c4b182b7d5544e8bcf0b88b785a2609f0f29 /src
parent3b2a1c1c69bae0de0ce04a93ec20b0f1221b42f6 (diff)
downloadopenttd-fa72a4ebd11d97551230c82dc19333c17e167a28.tar.xz
(svn r9902) -Fix (r9898): Don't check group owner when adding a vehicle to the 'default' group.
Diffstat (limited to 'src')
-rw-r--r--src/group_cmd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index bf445b3c3..7eaef6b89 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -205,8 +205,10 @@ int32 CmdAddVehicleGroup(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!IsValidVehicleID(p2) || (!IsValidGroupID(new_g) && !IsDefaultGroupID(new_g))) return CMD_ERROR;
- Group *g = GetGroup(new_g);
- if (g->owner != _current_player) return CMD_ERROR;
+ if (IsValidGroupID(new_g)) {
+ Group *g = GetGroup(new_g);
+ if (g->owner != _current_player) return CMD_ERROR;
+ }
Vehicle *v = GetVehicle(p2);
if (v->owner != _current_player || (v->type == VEH_TRAIN && !IsFrontEngine(v))) return CMD_ERROR;