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:
authorNick Samarin <nicks1987@bigmir.net>2010-06-16 04:23:24 +0400
committerNick Samarin <nicks1987@bigmir.net>2010-06-16 04:23:24 +0400
commit700c32e73833205830b062a13270e4a45668cad0 (patch)
treef8d684cdb2e487442cbff49abd8305e6f779a5d5 /source/gameengine/Ketsji/KX_SteeringActuator.cpp
parent147e8d01ebd7b04d81e2094669d8bc9b0f005f19 (diff)
- registration obstacle in game object
- creation obstacle on object replication (including navmesh object) - creation object transform for navigation mesh directly from blender object instead of using SGNode world transform (because SGNode doesn't exists yet when building navmesh on ProcessReplica)
Diffstat (limited to 'source/gameengine/Ketsji/KX_SteeringActuator.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_SteeringActuator.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index 04f01b01751..786c52413c9 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -105,13 +105,13 @@ bool KX_SteeringActuator::UnlinkObject(SCA_IObject* clientobj)
{
if (clientobj == m_target)
{
- // this object is being deleted, we cannot continue to track it.
+ // this object is being deleted, we cannot continue to use it.
m_target = NULL;
return true;
}
else if (clientobj == m_navmesh)
{
- // this object is being deleted, we cannot continue to track it.
+ // this object is being deleted, we cannot continue to useit.
m_navmesh = NULL;
return true;
}
@@ -159,6 +159,9 @@ bool KX_SteeringActuator::Update(double curtime, bool frame)
if (bNegativeEvent || !delta)
return false; // do nothing on negative events
+ if (!m_target)
+ return false;
+
KX_GameObject *obj = (KX_GameObject*) GetParent();
const MT_Point3& mypos = obj->NodeGetWorldPosition();
const MT_Point3& targpos = m_target->NodeGetWorldPosition();