Merge branch 'master' into jgrpp
# Conflicts: # Makefile.src.in # findversion.sh # projects/determineversion.vbs # src/aircraft_cmd.cpp # src/lang/dutch.txt # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraph_gui.h # src/order_cmd.cpp # src/settings_gui.cpp # src/smallmap_gui.cpp # src/town_cmd.cpp # src/viewport.cpp # src/water_map.h
This commit is contained in:
@@ -422,17 +422,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
|
||||
@@ -456,7 +445,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) {
|
||||
@@ -524,7 +512,6 @@ CommandCost CmdCreateGroupFromList(TileIndex tile, DoCommandFlag flags, uint32 p
|
||||
|
||||
if (!StrEmpty(text)) {
|
||||
if (Utf8StringLength(text) >= MAX_LENGTH_GROUP_NAME_CHARS) return CMD_ERROR;
|
||||
if (!IsUniqueGroupNameForVehicleType(text, vli.vtype)) return_cmd_error(STR_ERROR_NAME_MUST_BE_UNIQUE);
|
||||
}
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
|
Reference in New Issue
Block a user