[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55396] trunk/blender/source/gameengine/ Expressions/Value.cpp: bge bugfix: [#34677] Setting Boolean property on KX_GameObject creates Int type
Dalai Felinto
dfelinto at gmail.com
Mon Mar 18 23:52:44 CET 2013
Revision: 55396
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55396
Author: dfelinto
Date: 2013-03-18 22:52:43 +0000 (Mon, 18 Mar 2013)
Log Message:
-----------
bge bugfix: [#34677] Setting Boolean property on KX_GameObject creates Int type
we need to check for booleans before testing for longs.
Modified Paths:
--------------
trunk/blender/source/gameengine/Expressions/Value.cpp
Modified: trunk/blender/source/gameengine/Expressions/Value.cpp
===================================================================
--- trunk/blender/source/gameengine/Expressions/Value.cpp 2013-03-18 22:51:01 UTC (rev 55395)
+++ trunk/blender/source/gameengine/Expressions/Value.cpp 2013-03-18 22:52:43 UTC (rev 55396)
@@ -18,6 +18,7 @@
*
*/
#include "Value.h"
+#include "BoolValue.h"
#include "FloatValue.h"
#include "IntValue.h"
#include "VectorValue.h"
@@ -573,6 +574,11 @@
} else
#endif
+ /* note: Boolean check should go before Int check [#34677] */
+ if (PyBool_Check(pyobj))
+ {
+ vallie = new CBoolValue( (bool)PyLong_AsLongLong(pyobj) );
+ } else
if (PyFloat_Check(pyobj))
{
vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) );
More information about the Bf-blender-cvs
mailing list