From b2729f61fede40f5107649748d57470dc5a5a80a Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Mon, 25 Sep 2017 09:19:18 +0300 Subject: [PATCH] Bugfix for volcano code --- Models/Volcanoes/Kilauea/kilauea.nas | 4 ++-- Models/Volcanoes/Stromboli/stromboli.nas | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Models/Volcanoes/Kilauea/kilauea.nas b/Models/Volcanoes/Kilauea/kilauea.nas index 1c8838ff6..185003495 100644 --- a/Models/Volcanoes/Kilauea/kilauea.nas +++ b/Models/Volcanoes/Kilauea/kilauea.nas @@ -31,7 +31,7 @@ puu_oo_state_manager = func { - print ("Puu Oo state manager"); + #print ("Puu Oo state manager"); var state = getprop("/environment/volcanoes/kilauea/puu-oo-activity"); if (state == 3) @@ -51,4 +51,4 @@ puu_oo_state_manager(); - setlistener("/environment/volcanoes/kilauea/puu-oo-activity", puu_oo_state_manager); \ No newline at end of file + setlistener("/environment/volcanoes/kilauea/puu-oo-activity", puu_oo_state_manager); diff --git a/Models/Volcanoes/Stromboli/stromboli.nas b/Models/Volcanoes/Stromboli/stromboli.nas index 8562b89ff..db4fe0cef 100644 --- a/Models/Volcanoes/Stromboli/stromboli.nas +++ b/Models/Volcanoes/Stromboli/stromboli.nas @@ -1,4 +1,4 @@ - var stromboli_loop_flag = 1; + var stromboli_loop_flag = 0; var stromboli_central_factor = 1.0; var stromboli_side_factor = 1.0; @@ -72,7 +72,7 @@ stromboli_state_manager = func { - print ("Stromboli state manager"); + #print ("Stromboli state manager"); var state1 = getprop("/environment/volcanoes/stromboli/central-activity"); var state2 = getprop("/environment/volcanoes/stromboli/side-activity"); @@ -102,13 +102,13 @@ var state = state1; if (state2 > state) {state = state2;} - if (state > 1) + if ((state > 1) and (stromboli_loop_flag == 0)) { print("Starting Stromboli eruption simulation."); stromboli_loop_flag = 1; stromboli_loop(0.0, 0.0, 0.0, 0.0); } - else + else if (state <= 1) { stromboli_loop_flag = 0; } @@ -119,4 +119,4 @@ stromboli_state_manager(); setlistener("/environment/volcanoes/stromboli/central-activity", stromboli_state_manager); - setlistener("/environment/volcanoes/stromboli/side-activity", stromboli_state_manager); \ No newline at end of file + setlistener("/environment/volcanoes/stromboli/side-activity", stromboli_state_manager);