From e7b8a3357fc3e2205203dcc95b60432528758278 Mon Sep 17 00:00:00 2001 From: Untrustedlife Date: Mon, 7 Jan 2019 15:59:21 -0600 Subject: [PATCH] it now grabs that variable from the json for use later. --- src/microbe_stage/compounds.cpp | 2 +- src/microbe_stage/compounds.h | 1 + src/scripting/script_initializer.cpp | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/microbe_stage/compounds.cpp b/src/microbe_stage/compounds.cpp index dfb3eacbda7..4a8189b0cfc 100644 --- a/src/microbe_stage/compounds.cpp +++ b/src/microbe_stage/compounds.cpp @@ -10,7 +10,7 @@ Compound::Compound(Json::Value value) volume = value["volume"].asDouble(); isCloud = value["isCloud"].asBool(); isUseful = value["isUseful"].asBool(); - + isEnvironmental = value["isEnvironmental"].asBool(); // Setting the cloud colour. float r = value["colour"]["r"].asFloat(); float g = value["colour"]["g"].asFloat(); diff --git a/src/microbe_stage/compounds.h b/src/microbe_stage/compounds.h index 7cd8384b4d6..2e2c83eff4f 100644 --- a/src/microbe_stage/compounds.h +++ b/src/microbe_stage/compounds.h @@ -11,6 +11,7 @@ class Compound : public RegistryType { double volume = 1.0; bool isCloud = false; bool isUseful = false; + bool isEnvironmental = false; Ogre::ColourValue colour; Compound(); diff --git a/src/scripting/script_initializer.cpp b/src/scripting/script_initializer.cpp index 825947beb53..2eec1d0153c 100644 --- a/src/scripting/script_initializer.cpp +++ b/src/scripting/script_initializer.cpp @@ -211,6 +211,11 @@ bool ANGELSCRIPT_REGISTERFAIL; } + if(engine->RegisterObjectProperty( + "Compound", "bool isEnvironmental", asOFFSET(Compound, isEnvironmental)) < 0) { + ANGELSCRIPT_REGISTERFAIL; + } + if(engine->RegisterObjectProperty("Compound", "Ogre::ColourValue colour", asOFFSET(Compound, colour)) < 0) { ANGELSCRIPT_REGISTERFAIL;