Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/GameLogic/SCA_PropertyActuator.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyActuator.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
index 0eab6187d07..ea1b2a2bce3 100644
--- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
@@ -69,13 +69,24 @@ bool SCA_PropertyActuator::Update()
bool bNegativeEvent = IsNegativeEvent();
RemoveAllEvents();
-
+ CValue* propowner = GetParent();
if (bNegativeEvent)
- return false; // do nothing on negative events
+ {
+ if (m_type==KX_ACT_PROP_LEVEL)
+ {
+ CValue* newval = new CBoolValue(false);
+ CValue* oldprop = propowner->GetProperty(m_propname);
+ if (oldprop)
+ {
+ oldprop->SetValue(newval);
+ }
+ newval->Release();
+ }
+ return false;
+ }
- CValue* propowner = GetParent();
CParser parser;
parser.SetContext( propowner->AddRef());
@@ -97,6 +108,19 @@ bool SCA_PropertyActuator::Update()
}
newval->Release();
}
+ else if (m_type==KX_ACT_PROP_LEVEL)
+ {
+ CValue* newval = new CBoolValue(true);
+ CValue* oldprop = propowner->GetProperty(m_propname);
+ if (oldprop)
+ {
+ oldprop->SetValue(newval);
+ } else
+ {
+ propowner->SetProperty(m_propname,newval);
+ }
+ newval->Release();
+ }
else if ((userexpr = parser.ProcessText(m_exprtxt))) {
switch (m_type)
{