summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-02-26 21:07:22 +0000
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-03-03 12:04:29 +0100
commitc91e0058c27ac3f837de2735e2ce5fcfcd50b6ab (patch)
tree90c05367a1a144901211fedeb47f20fe962a3fe6 /src
parent5a5944867dfeaa556ec78c23af4796adb28a6a9f (diff)
downloadopenttd-c91e0058c27ac3f837de2735e2ce5fcfcd50b6ab.tar.xz
Change: Allow vehicle group names to be non-unique.
Group names are visual identifiers, and do not need to be unique. Group sorting already falls back to group ID if names are the same, so that sorted list position is stable.
Diffstat (limited to 'src')
-rw-r--r--src/group_cmd.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index b6590bc8f..bd99aa127 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -408,17 +408,6 @@ CommandCost CmdDeleteGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
return CommandCost();
}
-static bool IsUniqueGroupNameForVehicleType(const char *name, VehicleType type)
-{
- const Group *g;
-
- FOR_ALL_GROUPS(g) {
- if (g->name != NULL && g->vehicle_type == type && strcmp(g->name, name) == 0) return false;
- }
-
- return true;
-}
-
/**
* Alter a group
* @param tile unused
@@ -442,7 +431,6 @@ CommandCost CmdAlterGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
if (!reset) {
if (Utf8StringLength(text) >= MAX_LENGTH_GROUP_NAME_CHARS) return CMD_ERROR;
- if (!IsUniqueGroupNameForVehicleType(text, g->vehicle_type)) return_cmd_error(STR_ERROR_NAME_MUST_BE_UNIQUE);
}
if (flags & DC_EXEC) {