summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/players.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/players.cpp b/src/players.cpp
index b142f669b..b172f89b1 100644
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -695,11 +695,10 @@ int32 CmdSetAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
case 3: {
EngineID old_engine_type = GB(p2, 0, 16);
EngineID new_engine_type = GB(p2, 16, 16);
- GroupID id_g = GB(p1, 16, 8);
+ GroupID id_g = GB(p1, 16, 16);
int32 cost;
- if (!IsValidGroupID(id_g)) return CMD_ERROR;
-
+ if (!IsValidGroupID(id_g) && !IsDefaultGroupID(id_g)) return CMD_ERROR;
if (new_engine_type != INVALID_ENGINE) {
/* First we make sure that it's a valid type the user requested
* check that it's an engine that is in the engine array */