(svn r18494) -Fix (r18474): crash when moving non-engine to new free wagon chain and group count was off when moving a front engine within the same train and the new front isn't an engine.
This commit is contained in:
@@ -373,7 +373,7 @@ void SetTrainGroupID(Train *v, GroupID new_g)
|
||||
{
|
||||
if (!Group::IsValidID(new_g) && !IsDefaultGroupID(new_g)) return;
|
||||
|
||||
assert(v->IsFrontEngine());
|
||||
assert(v->IsFrontEngine() || IsDefaultGroupID(new_g));
|
||||
|
||||
for (Vehicle *u = v; u != NULL; u = u->Next()) {
|
||||
if (u->IsEngineCountable()) UpdateNumEngineGroup(u->engine_type, u->group_id, new_g);
|
||||
|
Reference in New Issue
Block a user