From 633addfd5c5f15b3f3566d26534c4c9fac7d3d82 Mon Sep 17 00:00:00 2001 From: milek7 Date: Fri, 26 Apr 2019 01:08:22 +0200 Subject: [PATCH] oneshot eventlauncher magic changed to -10000 --- EvLaunch.cpp | 9 +++------ simulation.cpp | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/EvLaunch.cpp b/EvLaunch.cpp index ae36869f..ce3badf6 100644 --- a/EvLaunch.cpp +++ b/EvLaunch.cpp @@ -68,7 +68,7 @@ bool TEventLauncher::Load(cParser *parser) } parser->getTokens(); *parser >> DeltaTime; - if (DeltaTime <= 0) + if (DeltaTime < 0.0) DeltaTime = -DeltaTime; // dla ujemnego zmieniamy na dodatni else if (DeltaTime > 0) { // wartość dodatnia oznacza wyzwalanie o określonej godzinie @@ -157,7 +157,7 @@ bool TEventLauncher::check_activation() { auto bCond { false }; - if (DeltaTime == 0.0) { + if (DeltaTime == 10000.0) { if (UpdatedTime == 0.0) bCond = true; UpdatedTime = 1.0; @@ -260,10 +260,7 @@ TEventLauncher::export_as_text_( std::ostream &Output ) const { Output << "none "; } // activation interval or hour - if (DeltaTime == 0.0) { - Output << "0 "; - } - else if( DeltaTime < 0.0 ) { + if( DeltaTime != 0.0 ) { // cyclical launcher Output << -DeltaTime << ' '; } diff --git a/simulation.cpp b/simulation.cpp index c0913394..5584449c 100644 --- a/simulation.cpp +++ b/simulation.cpp @@ -190,7 +190,7 @@ void state_manager::process_commands() { TAnimModel *model = simulation::State.create_model(data, name, commanddata.location); simulation::State.create_eventlauncher("node -1 0 launcher eventlauncher 0 0 0 " + std::to_string(model->radius()) - + " none 0.0 obstacle_collision end", name + "_snd", commanddata.location); + + " none -10000.0 obstacle_collision end", name + "_snd", commanddata.location); } if (commanddata.command == user_command::deletemodel) {