16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 01:19:18 +02:00

build 170509. minor fixes for pantograph logic and speed table calculations

This commit is contained in:
tmj-fstate
2017-05-09 20:26:22 +02:00
parent 54fc93f6e5
commit 6655011af7
2 changed files with 18 additions and 0 deletions

View File

@@ -226,6 +226,15 @@ bool TSpeedPos::Update(vector3 *p, vector3 *dir, double &len)
}
}
}
else {
if( fDist < 50.0 ) {
// old sceneries use trick of placing 'helper' semaphores underground, which can lead to vehicles running over them instead of stopping in front of them
// to account for it at short distances we redo distance calculation on 2d plane
fDist = glm::dot(
glm::vec3( v.x, 0.0, v.z ),
glm::vec3( dir->x, 0.0, dir->z ) );
}
}
}
if (fDist > 0.0) // nie może być 0.0, a przypadkiem mogło by się trafić i było by źle
@@ -391,6 +400,8 @@ void TController::TableClear()
iTableDirection = 0; // nieznany
tLast = nullptr;
fLastVel = -1.0;
SemNextIndex = -1;
SemNextStopIndex = -1;
eSignSkip = nullptr; // nic nie pomijamy
};