diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js index dd02ee852..3363b0be9 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnectNew.js @@ -361,7 +361,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri updateTrainModel.rotation.y = Math.PI; let point = updateTrainModel.curve.getPointAt(data.offset); updateTrainModel.position.x = point.x; - for (let tl=0; tl<6; tl++) { + for (let tl=0; tl=updateTrainModel.children[rs].rotalist[0].posr.x){ - if(rs != 5){ + if(rs != updateTrainModel.children.length-1){ let asd = updateTrainModel.children[rs].rotalist[0]; updateTrainModel.children[rs+1].rotalist.push(asd); @@ -488,7 +488,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri for(let xh=0;xh 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){ - for(let rs = 1;rs<6;rs++){ + for(let rs = 1;rs=trainmodel.children[rs].rotalist[0].posr.x){ - if(rs != 5){ + if(rs != trainmodel.children.length-1){ let asd = trainmodel.children[rs].rotalist[0]; trainmodel.children[rs+1].rotalist.push(asd); @@ -749,7 +749,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){ - for(let rs = 1;rs<6;rs++){ + for(let rs = 1;rs