[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23568] trunk/blender/source/gameengine/ GameLogic/SCA_PropertySensor.cpp: svn merge https://svn.blender.org/svnroot /bf-blender/branches/blender2.4 -r23566:23567
Campbell Barton
ideasman42 at gmail.com
Wed Sep 30 15:58:21 CEST 2009
Revision: 23568
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23568
Author: campbellbarton
Date: 2009-09-30 15:58:21 +0200 (Wed, 30 Sep 2009)
Log Message:
-----------
svn merge https://svn.blender.org/svnroot/bf-blender/branches/blender2.4 -r23566:23567
Modified Paths:
--------------
trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp
Modified: trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2009-09-30 13:19:42 UTC (rev 23567)
+++ trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2009-09-30 13:58:21 UTC (rev 23568)
@@ -38,6 +38,7 @@
#include "SCA_EventManager.h"
#include "SCA_LogicManager.h"
#include "BoolValue.h"
+#include "FloatValue.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -190,6 +191,22 @@
m_checkpropval.Upper();
}
result = (testprop == m_checkpropval);
+
+ /* Patch: floating point values cant use strings usefully since you can have "0.0" == "0.0000"
+ * this could be made into a generic Value class function for comparing values with a string.
+ */
+ if(result==false && dynamic_cast<CFloatValue *>(orgprop) != NULL) {
+ float f;
+
+ if(EOF == sscanf(m_checkpropval.ReadPtr(), "%f", &f))
+ {
+ //error
+ }
+ else {
+ result = (f == ((CFloatValue *)orgprop)->GetFloat());
+ }
+ }
+ /* end patch */
}
orgprop->Release();
More information about the Bf-blender-cvs
mailing list