diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-04-22 06:16:33 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-04-22 06:16:33 +0400 |
commit | 3b686116ea8c3878a316979a348987bc038a1f20 (patch) | |
tree | 0d2bfc003c760229276d5e2441807abdcad5adad /source/gameengine/Ketsji/KX_SteeringActuator.cpp | |
parent | e57d258169b0a358b27eb33416d949bfffbe7aea (diff) |
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.
Diffstat (limited to 'source/gameengine/Ketsji/KX_SteeringActuator.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_SteeringActuator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |