summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-19 12:46:48 +0000
committerrubidium <rubidium@openttd.org>2007-05-19 12:46:48 +0000
commit1434c7746d05b88f2d3cacfd7c9797d248009f4a (patch)
tree64cffe4a44d43069e15b7f3b1f8f87646a8f8bc6
parent4570a8954aab060a13838b9a932e4c92ea87057d (diff)
downloadopenttd-1434c7746d05b88f2d3cacfd7c9797d248009f4a.tar.xz
(svn r9879) -Fix (r9874): global autoreplace was little broken ;)
-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 */