mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r3373) -Fix: don't link a wagon to itself, which resulted in a wagon disapearing, and a depot which was unable to remove
This commit is contained in:
parent
183f6f6d07
commit
54501dc6df
|
@ -958,6 +958,8 @@ int32 CmdMoveRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
if (dst->next == NULL) {
|
if (dst->next == NULL) {
|
||||||
/* It's the last one, so we will add the wagon just before the rear engine */
|
/* It's the last one, so we will add the wagon just before the rear engine */
|
||||||
dst = GetPrevVehicleInChain(dst);
|
dst = GetPrevVehicleInChain(dst);
|
||||||
|
/* Now if the vehicle we want to link to is the vehicle itself, drop out */
|
||||||
|
if (dst == src) return CMD_ERROR;
|
||||||
// if dst is NULL, it means that dst got a rear multiheaded engine as first engine. We can't use that
|
// if dst is NULL, it means that dst got a rear multiheaded engine as first engine. We can't use that
|
||||||
if (dst == NULL) return CMD_ERROR;
|
if (dst == NULL) return CMD_ERROR;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue