(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:
rubidium
2009-12-13 22:17:12 +00:00
parent 2d249b9946
commit 75ed87aa71
2 changed files with 8 additions and 3 deletions

View File

@@ -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);