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:
authorCampbell Barton <ideasman42@gmail.com>2009-04-05 18:55:50 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-05 18:55:50 +0400
commit3dacfbb23161a1b779c2c4ac0f06431c5adda6a2 (patch)
tree3259019d0f807562b94051629c2776981f4da694 /source/gameengine/Expressions/ListValue.cpp
parent033a63f8580227582a9695ebdd78ac0b4322e867 (diff)
BGE Python API
- action attribute wasnt checking for NULL (own fault) - KX_Scene getCamera wasnt checking for NULL - CListValue had asserts for not yet implimented functionality, this would close blender. Better to print an error if the user manages to run this functions (I managed to by CListValue.count([1,2,3]))
Diffstat (limited to 'source/gameengine/Expressions/ListValue.cpp')
-rw-r--r--source/gameengine/Expressions/ListValue.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index 15eb8835b79..d0aec645468 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -430,6 +430,10 @@ bool CListValue::CheckEqual(CValue* first,CValue* second)
bool result = false;
CValue* eqval = ((CValue*)first)->Calc(VALUE_EQL_OPERATOR,(CValue*)second);
+
+ if (eqval==NULL)
+ return false;
+
STR_String txt = eqval->GetText();
eqval->Release();
if (txt=="TRUE")
@@ -479,7 +483,7 @@ PyObject* CListValue::Pycount(PyObject* self, PyObject* value)
if (checkobj==NULL) { /* in this case just return that there are no items in the list */
PyErr_Clear();
- PyInt_FromLong(0);
+ return PyInt_FromLong(0);
}
int numelem = GetCount();
@@ -503,7 +507,8 @@ PyObject* CListValue::Pycount(PyObject* self, PyObject* value)
* --------------------------------------------------------------------- */
CValue* CListValue::Calc(VALUE_OPERATOR op,CValue *val)
{
- assert(false); // todo: implement me!
+ //assert(false); // todo: implement me!
+ fprintf(stderr, "CValueList::Calc not yet implimented\n");
return NULL;
}
@@ -513,7 +518,8 @@ CValue* CListValue::CalcFinal(VALUE_DATA_TYPE dtype,
VALUE_OPERATOR op,
CValue* val)
{
- assert(false); // todo: implement me!
+ //assert(false); // todo: implement me!
+ fprintf(stderr, "CValueList::CalcFinal not yet implimented\n");
return NULL;
}