From 3b686116ea8c3878a316979a348987bc038a1f20 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 22 Apr 2012 02:16:33 +0000 Subject: Fix for bug #30219: "Obstacle Simulation of Steering Actuator does not work with added objects" The steering actuator was filling its m_obstacle member when it was created (i.e., conversion time), which meant it had the wrong pointer after the actuator was replicated. Now m_obstacle is reassigned when the actuator is replicated. --- source/gameengine/Ketsji/KX_SteeringActuator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/gameengine') diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index dd2ff2e305a..16b9285386a 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -117,6 +117,12 @@ void KX_SteeringActuator::ProcessReplica() SCA_IActuator::ProcessReplica(); } +void KX_SteeringActuator::ReParent(SCA_IObject* parent) +{ + SCA_IActuator::ReParent(parent); + if (m_simulation) + m_obstacle = m_simulation->GetObstacle((KX_GameObject*)m_gameobj); +} bool KX_SteeringActuator::UnlinkObject(SCA_IObject* clientobj) { -- cgit v1.2.3