network improvements

This commit is contained in:
milek7
2019-02-05 00:07:34 +01:00
parent 85ad17af3c
commit 5a0bb610db
10 changed files with 157 additions and 94 deletions

View File

@@ -1967,14 +1967,19 @@ event_manager::update() {
CheckQuery();
// test list of global events for possible new additions to the queue
for( auto *launcher : m_launcherqueue ) {
if (launcher->check_conditions() && launcher->Event1) {
// NOTE: we're presuming global events aren't going to use event2
if( true == ( launcher->check_activation() && launcher->check_conditions() ) ) {
// NOTE: we're presuming global events aren't going to use event2
WriteLog( "Eventlauncher " + launcher->name() );
if( launcher->Event1 ) {
AddToQuery( launcher->Event1, nullptr );
}
}
if (launcher->check_activation()) {
WriteLog( "Eventlauncher: " + launcher->name() );
AddToQuery( launcher->Event1, nullptr );
}
if (launcher->check_activation_key()) {
WriteLog( "Eventlauncher: " + launcher->name() );
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(launcher->Event1), 0.0, GLFW_PRESS, 0);
}
}
}
}