mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 12:59:33 +00:00
(svn r11019) -Fix [FS#1176]: Vehicles in a group must always have the same type when adding new vehicles to a group. Patch by SmatZ.
This commit is contained in:
parent
7f21de5ea9
commit
1b9ea5468e
@ -216,12 +216,13 @@ CommandCost CmdAddVehicleGroup(TileIndex tile, uint32 flags, uint32 p1, uint32 p
|
|||||||
|
|
||||||
if (!IsValidVehicleID(p2) || (!IsValidGroupID(new_g) && !IsDefaultGroupID(new_g))) return CMD_ERROR;
|
if (!IsValidVehicleID(p2) || (!IsValidGroupID(new_g) && !IsDefaultGroupID(new_g))) return CMD_ERROR;
|
||||||
|
|
||||||
|
Vehicle *v = GetVehicle(p2);
|
||||||
|
|
||||||
if (IsValidGroupID(new_g)) {
|
if (IsValidGroupID(new_g)) {
|
||||||
Group *g = GetGroup(new_g);
|
Group *g = GetGroup(new_g);
|
||||||
if (g->owner != _current_player) return CMD_ERROR;
|
if (g->owner != _current_player || g->vehicle_type != v->type) return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vehicle *v = GetVehicle(p2);
|
|
||||||
if (v->owner != _current_player || !v->IsPrimaryVehicle()) return CMD_ERROR;
|
if (v->owner != _current_player || !v->IsPrimaryVehicle()) return CMD_ERROR;
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
Loading…
Reference in New Issue
Block a user