16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 06:29:18 +02:00
This commit is contained in:
milek7
2019-01-18 00:26:48 +01:00
parent aa82349aee
commit f63bd04bfe
17 changed files with 542 additions and 463 deletions

View File

@@ -379,6 +379,7 @@ driver_mode::on_event_poll() {
void
driver_mode::update_camera( double const Deltatime ) {
Camera.Pos = Global.pCamera.Pos; // M7TODO
auto *controlled = (
simulation::Train ?
@@ -686,12 +687,14 @@ driver_mode::OnKeyDown(int cKey) {
break;
TDynamicObject *dynamic = std::get<TDynamicObject *>( simulation::Region->find_vehicle( Global.pCamera.Pos, 50, true, false ) );
TTrain *train = simulation::Trains.find(dynamic->name());
if (train) {
simulation::Train = train;
InOutKey();
} else {
m_relay.post(user_command::entervehicle, 0.0, 0.0, GLFW_PRESS, 0);
if (dynamic) {
TTrain *train = simulation::Trains.find(dynamic->name());
if (train) {
simulation::Train = train;
InOutKey();
} else {
m_relay.post(user_command::entervehicle, 0.0, 0.0, GLFW_PRESS, 0);
}
}
break;