BGE bug fix (good for 2.47): radar and near sensor did not filter correctly the colli...
authorBenoit Bolsee <benoit.bolsee@online.be>
Tue, 15 Jul 2008 18:57:10 +0000 (18:57 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Tue, 15 Jul 2008 18:57:10 +0000 (18:57 +0000)
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_RadarSensor.cpp

index d69871275b97bb7a255b61a4dfb16323a3664af3..89699d80031fc85894da93e49c5306a53e790279 100644 (file)
@@ -135,9 +135,6 @@ CValue* KX_NearSensor::GetReplica()
 
 void KX_NearSensor::ReParent(SCA_IObject* parent)
 {
-
-       SCA_ISensor::ReParent(parent);
-       
        m_client_info->m_gameobject = static_cast<KX_GameObject*>(parent); 
        m_client_info->m_sensors.push_back(this);
        
@@ -151,6 +148,7 @@ void KX_NearSensor::ReParent(SCA_IObject* parent)
 */
        ((KX_GameObject*)GetParent())->GetSGNode()->ComputeWorldTransforms(NULL);
        SynchronizeTransform();
+       SCA_ISensor::ReParent(parent);
 }
 
 
index 987e0b946b20e9774880e18847a0a70247e2503d..9dab09f8f2af990f190abeae756f54fb9f47cbab 100644 (file)
@@ -92,6 +92,10 @@ CValue* KX_RadarSensor::GetReplica()
        if (replica->m_physCtrl)
        {
                replica->m_physCtrl = replica->m_physCtrl->GetReplica();
+               if (replica->m_physCtrl)
+               {
+                       replica->m_physCtrl->setNewClientInfo(replica->m_client_info);
+               }
        }
 
        //todo: make sure replication works fine!