diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1202,7 +1202,7 @@ CommandCost CmdMoveRailVehicle(DoCommand dst = Train::GetIfValid(dest_veh); if (dst == nullptr) return CMD_ERROR; - CommandCost ret = CheckOwnership(dst->owner); + ret = CheckOwnership(dst->owner); if (ret.Failed()) return ret; /* Do not allow appending to crashed vehicles, too */ @@ -1271,7 +1271,7 @@ CommandCost CmdMoveRailVehicle(DoCommand /* If the autoreplace flag is set we do not need to test for the validity * because we are going to revert the train to its original state. As we * assume the original state was correct autoreplace can skip this. */ - CommandCost ret = ValidateTrains(original_dst_head, dst_head, original_src_head, src_head, true); + ret = ValidateTrains(original_dst_head, dst_head, original_src_head, src_head, true); if (ret.Failed()) { /* Restore the train we had. */ RestoreTrainBackup(original_src);