diff --git a/scripts/SimulationParameters/MicrobeStage/BioProcesses.json b/scripts/SimulationParameters/MicrobeStage/BioProcesses.json index 42de82ea05c..98d60c0515c 100644 --- a/scripts/SimulationParameters/MicrobeStage/BioProcesses.json +++ b/scripts/SimulationParameters/MicrobeStage/BioProcesses.json @@ -8,7 +8,7 @@ }, "outputs": { - "atp": 14.0 + "atp": 38.0 } }, @@ -95,7 +95,7 @@ }, "outputs": { - "atp": 14.0 + "atp": 38.0 } }, diff --git a/src/microbe_stage/process_system.cpp b/src/microbe_stage/process_system.cpp index 7aa6c6a966b..dd293f4bc71 100644 --- a/src/microbe_stage/process_system.cpp +++ b/src/microbe_stage/process_system.cpp @@ -225,17 +225,20 @@ void // do environmental modifier here, and save it for later if(compoundData.isEnvironmental) { - environmentModifier = environmentModifier * - getDissolved(inputId) * input.second; + environmentModifier = + environmentModifier * + (getDissolved(inputId) / input.second); inputRemoved = inputRemoved * environmentModifier; } // If not enough compound we can't do the process // If the compound is environmental the cell doesnt actually // contain it right now and theres no where to take it from - if(bag.compounds[inputId].amount < inputRemoved || - environmentModifier == 0.0f) { - canDoProcess = false; + if(!compoundData.isEnvironmental) { + if(bag.compounds[inputId].amount < inputRemoved || + environmentModifier == 0.0f) { + canDoProcess = false; + } } } diff --git a/src/microbe_stage/process_system.h b/src/microbe_stage/process_system.h index 4dee5f4c7b5..bb80cc9bd9c 100644 --- a/src/microbe_stage/process_system.h +++ b/src/microbe_stage/process_system.h @@ -142,12 +142,10 @@ class ProcessSystem void setProcessBiome(int biomeId); - -protected: double getDissolved(CompoundId compoundData); - +protected: private: int curBiomeId = 0; static constexpr double TIME_SCALING_FACTOR = 1000; diff --git a/src/scripting/script_initializer.cpp b/src/scripting/script_initializer.cpp index 708e6ca161b..3cba9c41b3e 100644 --- a/src/scripting/script_initializer.cpp +++ b/src/scripting/script_initializer.cpp @@ -1148,6 +1148,12 @@ bool asMETHOD(ProcessSystem, setProcessBiome), asCALL_THISCALL) < 0) { ANGELSCRIPT_REGISTERFAIL; } + + if(engine->RegisterObjectMethod("ProcessSystem", + "void getDissolved(CompoundId compoundData)", + asMETHOD(ProcessSystem, getDissolved), asCALL_THISCALL) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } // ------------------------------------ // // CompoundCloudSystem if(engine->RegisterObjectType(