Merged 15170:15635 from trunk (no conflicts or even merges)
[blender.git] / source / gameengine / Ketsji / KX_RadarSensor.cpp
index 31fffffa3c14651493888ba48e52d0cad9dece4c..bf2ba18f4905adf6979ddd386421ff1d889585dc 100644 (file)
@@ -71,7 +71,6 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr,
        //sumoObj->setClientObject(&m_client_info);
 }
                        
-
 KX_RadarSensor::~KX_RadarSensor()
 {
        
@@ -81,10 +80,7 @@ CValue* KX_RadarSensor::GetReplica()
 {
        KX_RadarSensor* replica = new KX_RadarSensor(*this);
        replica->m_colliders = new CListValue();
-       replica->m_bCollision = false;
-       replica->m_bTriggered= false;
-       replica->m_hitObject = NULL;
-       replica->m_bLastTriggered = false;
+       replica->Init();
        // this will copy properties and so on...
        CValue::AddDataToReplica(replica);
        
@@ -93,6 +89,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!