diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2019-03-26 00:17:33 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-27 06:58:48 +0000 |
commit | a393c9469545f4bd1e6e2fd1a593d35bb98f16ca (patch) | |
tree | 988930ec3e5ed0de1be7ad50c419d953757ea38c | |
parent | ed9005690a77a9bdfe334f79f6df0c421975161d (diff) | |
download | openttd-a393c9469545f4bd1e6e2fd1a593d35bb98f16ca.tar.xz |
Change #5977: Use specific error message when attempting to create a circular group hierarchy (3298)
-rw-r--r-- | src/group_cmd.cpp | 2 | ||||
-rw-r--r-- | src/lang/english.txt | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index bd99aa127..3c9b3850a 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -449,7 +449,7 @@ CommandCost CmdAlterGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* Ensure request parent isn't child of group. * This is the only place that infinite loops are prevented. */ - if (GroupIsInGroup(pg->index, g->index)) return CMD_ERROR; + if (GroupIsInGroup(pg->index, g->index)) return_cmd_error(STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION); } if (flags & DC_EXEC) { diff --git a/src/lang/english.txt b/src/lang/english.txt index 2e01e3a2d..032801ae5 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -4473,6 +4473,7 @@ STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Can't cr STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Can't delete this group... STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Can't rename group... STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Can't set parent group... +STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION :{WHITE}... loops in the group hierarchy are not allowed STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Can't remove all vehicles from this group... STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Can't add the vehicle to this group... STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Can't add shared vehicles to group... |