Skip to content

Commit

Permalink
Fix OpenTTD#7224: Drag and drop vehicle group creation does not work …
Browse files Browse the repository at this point in the history
…correctly.

When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
  • Loading branch information
stormcone authored and michicc committed Jun 30, 2019
1 parent c62df7c commit 0fdc320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/group_cmd.cpp
Expand Up @@ -536,7 +536,7 @@ CommandCost CmdAddVehicleGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, u

if (new_g == NEW_GROUP) {
/* Create new group. */
CommandCost ret = CmdCreateGroup(0, flags, v->type, 0, NULL);
CommandCost ret = CmdCreateGroup(0, flags, v->type, INVALID_GROUP, NULL);
if (ret.Failed()) return ret;

new_g = _new_group_id;
Expand Down

0 comments on commit 0fdc320

Please sign in to comment.