summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-02-03 09:16:48 +0000
committerPeterN <peter@fuzzle.org>2019-02-03 15:52:19 +0000
commitcca952d94bad599541c3f3ca417a72355262649a (patch)
tree203b122ea5e6e59061f7274669748a63f96fbf56
parente21ade375ee008fa32db8e154f14fb18b37e8dc7 (diff)
downloadopenttd-cca952d94bad599541c3f3ca417a72355262649a.tar.xz
Fix #7108: Group livery command did not check its parameters properly.
-rw-r--r--src/group_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index 7795d917d..29dc17edd 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -658,6 +658,8 @@ CommandCost CmdSetGroupLivery(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
if (g == NULL || g->owner != _current_company) return CMD_ERROR;
+ if (colour >= COLOUR_END && colour != INVALID_COLOUR) return CMD_ERROR;
+
if (flags & DC_EXEC) {
if (primary) {
SB(g->livery.in_use, 0, 1, colour != INVALID_COLOUR);