diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-07-06 18:11:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-07-06 18:11:30 +0400 |
commit | 8a729824f454bfee6c66db1db0411ecc5fd4ad38 (patch) | |
tree | 380f40749764d28d64c1d55d86287408573cb707 /source/gameengine/Ketsji | |
parent | 1df2701fd78232b9f463531f1c707643d14de6cd (diff) |
GameObject rayCast and rayCastTo were not setting exception strings (causes return without exception set error)
Also made game state buttons only have a dot in states that have controllers in them.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 507cedcd5d3..bde5e2cd0a2 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1506,8 +1506,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, { KX_GameObject *other; PyErr_Clear(); - if (!PyType_IsSubtype(pyarg->ob_type, &KX_GameObject::Type)) + if (!PyType_IsSubtype(pyarg->ob_type, &KX_GameObject::Type)) { + PyErr_SetString(PyExc_TypeError, "the first argument to rayCastTo must be a vector or a KX_GameObject"); return NULL; + } other = static_cast<KX_GameObject*>(pyarg); toPoint = other->NodeGetWorldPosition(); } @@ -1567,8 +1569,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, if (!PyVecTo(pyto, toPoint)) { PyErr_Clear(); - if (!PyType_IsSubtype(pyto->ob_type, &KX_GameObject::Type)) + if (!PyType_IsSubtype(pyto->ob_type, &KX_GameObject::Type)) { + PyErr_SetString(PyExc_TypeError, "the first argument to rayCast must be a vector or a KX_GameObject"); return NULL; + } other = static_cast<KX_GameObject*>(pyto); toPoint = other->NodeGetWorldPosition(); } @@ -1579,8 +1583,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, else if (!PyVecTo(pyfrom, fromPoint)) { PyErr_Clear(); - if (!PyType_IsSubtype(pyfrom->ob_type, &KX_GameObject::Type)) + if (!PyType_IsSubtype(pyfrom->ob_type, &KX_GameObject::Type)) { + PyErr_SetString(PyExc_TypeError, "the second optional argument to rayCast must be a vector or a KX_GameObject"); return NULL; + } other = static_cast<KX_GameObject*>(pyfrom); fromPoint = other->NodeGetWorldPosition(); } |