# HG changeset patch # User hackykid # Date 2005-06-06 21:32:04 # Node ID 305bb198f3332360621371c45f7739db5efe8553 # Parent d5c216cb79ed22bdf92526b4981956f4574041d5 (svn r2427) - Fix: CmdMoveRailVehice; Prevent possible assertion failure when moving vehicles within one chain. diff --git a/train_cmd.c b/train_cmd.c --- a/train_cmd.c +++ b/train_cmd.c @@ -845,6 +845,9 @@ int32 CmdMoveRailVehicle(int x, int y, u src_head = NULL; } } else { + // if moving within the same chain, dont use dst_head as it may get invalidated + if (src_head == dst_head) + dst_head = NULL; // unlink single wagon from linked list src_head = UnlinkWagon(src, src_head); src->next = NULL;