BGE C++ API
authorCampbell Barton <ideasman42@gmail.com>
Wed, 22 Apr 2009 14:42:00 +0000 (14:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 22 Apr 2009 14:42:00 +0000 (14:42 +0000)
PyObjectPlus::ProcessReplica() is now called when any of its subclasses are replicated.

This is important because PyObjectPlus::ProcessReplica() NULL's the 'm_proxy' python pointer I added recently.
Without this a replicated subclass of PyObjectPlus could have an invalid pointer (crashing the BGE).

This change also means CValue::AddDataToReplica() can be moved into CValue::ProcessReplica() since ProcessReplica is always called.

61 files changed:
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_DeformableGameObject.cpp
source/gameengine/Converter/BL_ModifierDeformer.cpp
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Expressions/BoolValue.cpp
source/gameengine/Expressions/EmptyValue.cpp
source/gameengine/Expressions/FloatValue.cpp
source/gameengine/Expressions/IntValue.cpp
source/gameengine/Expressions/ListValue.cpp
source/gameengine/Expressions/StringValue.cpp
source/gameengine/Expressions/Value.cpp
source/gameengine/Expressions/Value.h
source/gameengine/Expressions/VectorValue.cpp
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_ANDController.cpp
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
source/gameengine/GameLogic/SCA_DelaySensor.cpp
source/gameengine/GameLogic/SCA_ExpressionController.cpp
source/gameengine/GameLogic/SCA_IActuator.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_NANDController.cpp
source/gameengine/GameLogic/SCA_NORController.cpp
source/gameengine/GameLogic/SCA_ORController.cpp
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GameLogic/SCA_RandomSensor.cpp
source/gameengine/GameLogic/SCA_XNORController.cpp
source/gameengine/GameLogic/SCA_XORController.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KX_CDActuator.cpp
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.h
source/gameengine/Ketsji/KX_GameActuator.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_IpoActuator.h
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.h
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_StateActuator.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/KX_TrackToActuator.h
source/gameengine/Ketsji/KX_VisibilityActuator.cpp

index 3002005ae3f5db3279270b4c519d4043789964a9..e06008ff8918b3b69fcd409ea410d6a0203cd6a9 100644 (file)
@@ -66,9 +66,9 @@ BL_ActionActuator::~BL_ActionActuator()
                game_free_pose(m_blendpose);
 }
 
-void BL_ActionActuator::ProcessReplica(){
-//     bPose *oldpose = m_pose;
-//     bPose *oldbpose = m_blendpose;
+void BL_ActionActuator::ProcessReplica()
+{
+       SCA_IActuator::ProcessReplica();
        
        m_pose = NULL;
        m_blendpose = NULL;
@@ -84,9 +84,6 @@ void BL_ActionActuator::SetBlendTime (float newtime){
 CValue* BL_ActionActuator::GetReplica() {
        BL_ActionActuator* replica = new BL_ActionActuator(*this);//m_float,GetName());
        replica->ProcessReplica();
-       
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 }
 
index 04e2c55e7ddabdc641ceebe512d1193a562d6fd9..b00b493193ddad0e185b507fb0b4e42035876819 100644 (file)
@@ -70,10 +70,6 @@ BL_ArmatureObject::BL_ArmatureObject(
 CValue* BL_ArmatureObject::GetReplica()
 {
        BL_ArmatureObject* replica = new BL_ArmatureObject(*this);
-       
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-
        replica->ProcessReplica();
        return replica;
 }
index 618744dc1f32840f3a58b3b7c32df27bc8e244ee..241ff8d2aaf8ebb8c8f397728413d7f7bbcd3541 100644 (file)
@@ -53,10 +53,6 @@ CValue*              BL_DeformableGameObject::GetReplica()
 {
 
        BL_DeformableGameObject* replica = new BL_DeformableGameObject(*this);//m_float,GetName());
-       
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-
        replica->ProcessReplica();
        return replica;
 }
index 6113f88e33133c054508c00cfa2e2de8d3610df0..79ee6be47f0123fc0659772440353cc63217d513 100644 (file)
@@ -87,6 +87,7 @@ RAS_Deformer *BL_ModifierDeformer::GetReplica(class KX_GameObject* replica)
 
 void BL_ModifierDeformer::ProcessReplica()
 {
+       /* Note! - This is not inherited from PyObjectPlus */
        BL_ShapeDeformer::ProcessReplica();
        m_dm = NULL;
        m_lastModifierUpdate = -1;
index a447ffb8aa949676a4926adcbc1b12e7a2941285..60d26b9a99f4811becfd5626efdd45d97cb777c9 100644 (file)
@@ -61,6 +61,7 @@ BL_ShapeActionActuator::~BL_ShapeActionActuator()
 
 void BL_ShapeActionActuator::ProcessReplica()
 {
+       SCA_IActuator::ProcessReplica();
        m_localtime=m_startframe;
        m_lastUpdate=-1;
 }
@@ -74,9 +75,6 @@ CValue* BL_ShapeActionActuator::GetReplica()
 {
        BL_ShapeActionActuator* replica = new BL_ShapeActionActuator(*this);//m_float,GetName());
        replica->ProcessReplica();
-       
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 }
 
index ae3e1a10005763a020a7f5a6751b09780f0f1d1e..3267dbce410a3e8a863c4045396e5b53e932cfcc 100644 (file)
@@ -156,6 +156,8 @@ RAS_Deformer *BL_SkinDeformer::GetReplica(class KX_GameObject* replica)
        BL_SkinDeformer *result;
 
        result = new BL_SkinDeformer(*this);
+       /* Not inherited from PyObjectPlus so this isnt needed */
+       /* Just call a dummy function below, will be optimized out */
        result->ProcessReplica();
        return result;
 }
index 13c870b68e54600d4c9acbab3edc93bc465e4033..4e0a71e5a198c5e0c4ccb6048eb94fc793dfb094 100644 (file)
@@ -201,7 +201,7 @@ const STR_String& CBoolValue::GetText()
 CValue* CBoolValue::GetReplica()
 {
        CBoolValue* replica = new CBoolValue(*this);
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        
        return replica;
 }
index f72ddc470960fc7cdec5f9233cb03391c287f3e0..5d1273b5301af6981925825acaa9988269a9f72d 100644 (file)
@@ -121,7 +121,7 @@ const STR_String & CEmptyValue::GetText()
 CValue* CEmptyValue::GetReplica()
 { 
        CEmptyValue* replica = new CEmptyValue(*this);
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        return replica;
 }
 
index 212a55fe4578bd4f4dac2215214296067eabf14d..a31d3b9a528173e43bd4c54b0d202cebc15210ca 100644 (file)
@@ -307,8 +307,8 @@ const STR_String & CFloatValue::GetText()
 CValue* CFloatValue::GetReplica()
 { 
        CFloatValue* replica = new CFloatValue(*this);
-       replica->m_pstrRep = NULL;
-       CValue::AddDataToReplica(replica);
+       replica->m_pstrRep = NULL; /* should be in CFloatValue::ProcessReplica() but its not defined, no matter */
+       replica->ProcessReplica();
 
        return replica;
 }
index 4e86f7bf7899b995360adb8b65be19ec00cab94f..74ec9865fecc450c93a0d9a91adbf5e2a60cca9a 100644 (file)
@@ -311,7 +311,7 @@ const STR_String & CIntValue::GetText()
 
 CValue* CIntValue::GetReplica() { 
        CIntValue* replica = new CIntValue(*this);
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        replica->m_pstrRep = NULL;
        
        return replica;
index 7c31a29f4ac271db270bf28060afc79148985499..6c92e805745b0748d6d1e879cac974a0f10775c0 100644 (file)
@@ -324,7 +324,7 @@ const STR_String & CListValue::GetText()
 CValue* CListValue::GetReplica() { 
        CListValue* replica = new CListValue(*this);
 
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        replica->m_bReleaseContents=true; // for copy, complete array is copied for now...
        // copy all values
index 2b3c62c411e579fdac063a730c6f162a0c244422..857aa97b4203134b2ccd9d66feecc62c6c882c77 100644 (file)
@@ -133,7 +133,7 @@ bool CStringValue::IsEqual(const STR_String & other)
 CValue* CStringValue::GetReplica()
 { 
        CStringValue* replica = new CStringValue(*this);
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        return replica;
 };
 
index 106bd1256a6331440ec65d0c1310f3fd6ab50c14..b5aca518e881adc8dc35ba7d35630f5bca84b7f3 100644 (file)
@@ -439,27 +439,6 @@ int CValue::GetPropertyCount()
 }
 
 
-
-
-
-void CValue::CloneProperties(CValue *replica)
-{
-       
-       if (m_pNamedPropertyArray)
-       {
-               replica->m_pNamedPropertyArray=NULL;
-               std::map<STR_String,CValue*>::iterator it;
-               for (it= m_pNamedPropertyArray->begin(); (it != m_pNamedPropertyArray->end()); it++)
-               {
-                       CValue *val = (*it).second->GetReplica();
-                       replica->SetProperty((*it).first,val);
-                       val->Release();
-               }
-       }
-
-       
-}
-
 double*                CValue::GetVector3(bool bGetTransformedVec)
 {
        assertd(false); // don;t get vector from me
@@ -534,22 +513,33 @@ void CValue::DisableRefCount()
 
 
 
-void CValue::AddDataToReplica(CValue *replica)
+void CValue::ProcessReplica() /* was AddDataToReplica in 2.48 */
 {
-       replica->m_refcount = 1;
-
+       m_refcount = 1;
+       
 #ifdef _DEBUG
        //gRefCountValue++;
 #endif
-       replica->m_ValFlags.RefCountDisabled = false;
+       PyObjectPlus::ProcessReplica();
 
-       replica->ReplicaSetName(GetName());
-
-       //copy all props
-       CloneProperties(replica);
-}
+       m_ValFlags.RefCountDisabled = false;
 
+       ReplicaSetName(GetName());
 
+       /* copy all props */
+       if (m_pNamedPropertyArray)
+       {
+               std::map<STR_String,CValue*> *pOldArray = m_pNamedPropertyArray;
+               m_pNamedPropertyArray=NULL;
+               std::map<STR_String,CValue*>::iterator it;
+               for (it= pOldArray->begin(); (it != pOldArray->end()); it++)
+               {
+                       CValue *val = (*it).second->GetReplica();
+                       SetProperty((*it).first,val);
+                       val->Release();
+               }
+       }
+}
 
 CValue*        CValue::FindIdentifier(const STR_String& identifiername)
 {
index 88186fa95c041c4c6dee79b4bd175ba4be42cc55..cc791351d8ac5e85e0ffa5cddf438fc943e86a7e 100644 (file)
@@ -281,7 +281,6 @@ public:
        virtual CValue*         GetProperty(int inIndex);                                                               // Get property number <inIndex>
        virtual int                     GetPropertyCount();                                                                             // Get the amount of properties assiocated with this value
 
-       virtual void            CloneProperties(CValue* replica);
        virtual CValue*         FindIdentifier(const STR_String& identifiername);
        /** Set the wireframe color of this value depending on the CSG
         * operator type <op>
@@ -300,6 +299,7 @@ public:
         * @attention this particular function should never be called. Why not abstract? */
        virtual void            SetValue(CValue* newval);
        virtual CValue*         GetReplica() =0;
+       virtual void                    ProcessReplica();
        //virtual CValue*               Copy() = 0;
        
        
@@ -328,10 +328,10 @@ public:
 
        virtual void            SetCustomFlag2(bool bCustomFlag)                                                { m_ValFlags.CustomFlag2 = bCustomFlag;};
        virtual bool            IsCustomFlag2()                                                                                 { return m_ValFlags.CustomFlag2;};
-                                                                                                                                                               
+
 protected:                                                                                                                                             
        virtual void            DisableRefCount();                                                                              // Disable reference counting for this value
-       virtual void            AddDataToReplica(CValue* replica);                                              
+       //virtual void          AddDataToReplica(CValue* replica);                                              
        virtual                         ~CValue();
 private:
        // Member variables                                                                                                                     
index 497a50b90e78543405f3c1759a79b5466c275a9c..e8e1d45c356a098cdef3487d1eaf7fed2ac12d0c 100644 (file)
@@ -204,7 +204,7 @@ const STR_String & CVectorValue::GetText()
 
 CValue* CVectorValue::GetReplica() { 
        CVectorValue* replica = new CVectorValue(*this);
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        return replica;
 };
 
index 9bf03bf39cc8670454469f77429b455e278cd7c3..ed83458741408170207ed90f38b5bee15c18ca3a 100644 (file)
@@ -64,8 +64,6 @@ CValue* SCA_2DFilterActuator::GetReplica()
 {
     SCA_2DFilterActuator* replica = new SCA_2DFilterActuator(*this);
     replica->ProcessReplica();
-    CValue::AddDataToReplica(replica);
-
     return replica;
 }
 
index e4642750942423464457049728df9130a4c28981..ed2372200e9f6f6454d0a043519cc100be98b97e 100644 (file)
@@ -94,7 +94,7 @@ CValue* SCA_ANDController::GetReplica()
 {
        CValue* replica = new SCA_ANDController(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 4c85c4f8e5e9c78c0f3f4dd2b825f1c4dba7cf1d..928060d7394b38b5aab032425c3ec7ff6c858304 100644 (file)
@@ -60,7 +60,7 @@ CValue* SCA_ActuatorSensor::GetReplica()
 {
        SCA_ActuatorSensor* replica = new SCA_ActuatorSensor(*this);
        // m_range_expr must be recalculated on replica!
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        replica->Init();
 
        return replica;
index 874883c89b10743ee259902fb7a7093440dbb310..941f3b55b446c0360b7a4371bb4f4beb6468cdb9 100644 (file)
@@ -72,7 +72,7 @@ CValue* SCA_AlwaysSensor::GetReplica()
 {
        CValue* replica = new SCA_AlwaysSensor(*this);//m_float,GetName());
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 0e4a00e27459d13d646558c8a212006425e2ec2b..15e805a657c1bafae4ceb8694ba52d2481faaa18 100644 (file)
@@ -77,7 +77,7 @@ CValue* SCA_DelaySensor::GetReplica()
 {
        CValue* replica = new SCA_DelaySensor(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 352a39a6fea646413213ed5681bc9d02d72957b1..e6bccef08d4a724b15e33193be773da006608d28 100644 (file)
@@ -70,7 +70,7 @@ CValue* SCA_ExpressionController::GetReplica()
        replica->m_exprText = m_exprText;
        replica->m_exprCache = NULL;
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 309f3108418e2743e8fe92d8467a1b5377b0ebbf..3d4ad3aec3a0754bac1e6281aadd416c8bc34cc9 100644 (file)
@@ -100,6 +100,7 @@ bool SCA_IActuator::Update()
 
 void SCA_IActuator::ProcessReplica()
 {
+       SCA_ILogicBrick::ProcessReplica();
        m_events.clear();
 }
 
index a8c6f87ebdd1e74c2a4c0338edca14c2e93e6e2f..11b31c67edd5e9d2eb802aee85bf4a3f05864fc1 100644 (file)
@@ -87,7 +87,7 @@ CValue* SCA_JoystickSensor::GetReplica()
 {
        SCA_JoystickSensor* replica = new SCA_JoystickSensor(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        replica->Init();
        return replica;
 }
index 2048731f73c3a2f5bf7dc38fc6ef7fd62cc8e154..5dcdb2227137e17c2aed3d9542b6f2801f213c7b 100644 (file)
@@ -85,7 +85,7 @@ CValue* SCA_KeyboardSensor::GetReplica()
 {
        SCA_KeyboardSensor* replica = new SCA_KeyboardSensor(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        replica->Init();
        return replica;
 }
index 0bae676d19d12179d9168d58ed510e5c9493038f..65942327e6847035476921cce376492b99cef1d4 100644 (file)
@@ -111,7 +111,7 @@ CValue* SCA_MouseSensor::GetReplica()
 {
        SCA_MouseSensor* replica = new SCA_MouseSensor(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        replica->Init();
 
        return replica;
index dedf32df3c9b670aa7edc5138b4cf850dbba662c..ab5c39dc0397c8d697e9b38492887784270c40df 100644 (file)
@@ -94,7 +94,7 @@ CValue* SCA_NANDController::GetReplica()
 {
        CValue* replica = new SCA_NANDController(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 8cd575ffef3a3e02680f935ed7c063b7d816457e..918e6a348ae716509a549b7e284b176cd218e01a 100644 (file)
@@ -94,7 +94,7 @@ CValue* SCA_NORController::GetReplica()
 {
        CValue* replica = new SCA_NORController(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index a12246e9a7336aabae5bad3d3d58f376844b51a5..034c3ee29cdd501898ef90966ce4d45339b84ce4 100644 (file)
@@ -60,7 +60,7 @@ CValue* SCA_ORController::GetReplica()
 {
        CValue* replica = new SCA_ORController(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 4facd8df27a6536de530fe4e2e14d8e3dd432bdc..f3ca63066c9368360ec216d61a289b65e18a9efd 100644 (file)
@@ -186,11 +186,6 @@ GetReplica() {
        SCA_PropertyActuator* replica = new SCA_PropertyActuator(*this);
 
        replica->ProcessReplica();
-
-       // this will copy properties and so on...
-
-       CValue::AddDataToReplica(replica);
-
        return replica;
 
 };
index c56dd3a12f4247c219dfc9e63fae32f6fcb9f24c..7953698c6ef82a81665a0a2b283e9fcb9031a12b 100644 (file)
@@ -111,7 +111,7 @@ CValue* SCA_PropertySensor::GetReplica()
 {
        SCA_PropertySensor* replica = new SCA_PropertySensor(*this);
        // m_range_expr must be recalculated on replica!
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        replica->Init();
 
        replica->m_range_expr = NULL;
index b80525555287fe8a3b21d0cb21f0327f146cd76d..ab4b5600d3f0f66469f69163f4f0f69ec82d6525 100644 (file)
@@ -110,7 +110,7 @@ CValue* SCA_PythonController::GetReplica()
        */
        
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index b9df198f7daf0d99039f5d58fedc4e9306fd87eb..91110425f7f959ac780ff4fc2794149c942e1f2d 100644 (file)
@@ -78,8 +78,6 @@ CValue* SCA_RandomActuator::GetReplica()
        SCA_RandomActuator* replica = new SCA_RandomActuator(*this);
        // replication just copy the m_base pointer => common random generator
        replica->ProcessReplica();
-       CValue::AddDataToReplica(replica);
-
        return replica;
 }
 
index 582cff4cde71bf6ab729f0a5fc2921bb08b91f71..70a23124929f3a174a38094b0c7df767b9f8e534 100644 (file)
@@ -76,7 +76,7 @@ CValue* SCA_RandomSensor::GetReplica()
        CValue* replica = new SCA_RandomSensor(*this);
        // replication copies m_basegenerator pointer => share same generator
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 145afa6aec527174db2f5f76af717ff8e29efd61..13d50100d6cca506bf198af3dd9afd2f0613dcfc 100644 (file)
@@ -98,7 +98,7 @@ CValue* SCA_XNORController::GetReplica()
 {
        CValue* replica = new SCA_XNORController(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 4dfba3a56acafc73c9451f527471e5fad3ab65d6..6613742a080bfb6e784cfda3d713cf6af286578b 100644 (file)
@@ -98,7 +98,7 @@ CValue* SCA_XORController::GetReplica()
 {
        CValue* replica = new SCA_XORController(*this);
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 9c36a89950524d5c94de9aa23ce653020b3b85cd..712f64d5f8fcd52c39e7da046183a028a12ecb0f 100644 (file)
@@ -93,9 +93,6 @@ CValue* KX_NetworkMessageActuator::GetReplica()
            new KX_NetworkMessageActuator(*this);
        replica->ProcessReplica();
 
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-
        return replica;
 }
 
index b1b9c0e1fc951370efa43117d132458565b42c97..d770465e1ea0f079923ced701321c70e056c3133 100644 (file)
@@ -79,9 +79,7 @@ CValue* KX_NetworkMessageSensor::GetReplica() {
        CValue* replica = new KX_NetworkMessageSensor(*this);
 
        if (replica == NULL) return NULL;
-
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
 
        return replica;
 }
index 6e318cdcfa3c501fca57c855b6c7fa26aa05d584..a0b2c73901fb20b7674d861d31669662aeb8a6a4 100644 (file)
@@ -74,9 +74,6 @@ CValue* KX_CDActuator::GetReplica()
 {
        KX_CDActuator* replica = new KX_CDActuator(*this);
        replica->ProcessReplica();
-       
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 };
 
index e1784a4cd3785a293d7a7d2cdf638d4552325173..e536d1f1e7ec28b1b54642a96a844c41755ec4fa 100644 (file)
@@ -71,7 +71,6 @@ CValue*       KX_Camera::GetReplica()
        KX_Camera* replica = new KX_Camera(*this);
        
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        replica->ProcessReplica();
        
        return replica;
index 2ef7abfd1720afedccc28858038f8d4f3122c5e8..38a68752958c6ccbee4b193cc563ccebcd2e5d08 100644 (file)
@@ -82,8 +82,6 @@ GetReplica(
 ) {
        KX_CameraActuator* replica = new KX_CameraActuator(*this);
        replica->ProcessReplica();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 };
 
index 84512c0ecf28ec815a7e8bd19fac210999692839..40607b449478a54519cf0a767f9cdfb254e44e60 100644 (file)
@@ -132,8 +132,6 @@ protected:
        virtual CValue* GetReplica() {
                KX_ConstraintActuator* replica = new KX_ConstraintActuator(*this);
                replica->ProcessReplica();
-               // this will copy properties and so on...
-               CValue::AddDataToReplica(replica);
                return replica;
        };
 
index 0a411396ff81bd44264e7582fc803bc14f05cf72..514fb74f6bfa2f1165c87e92fd76d52ba1da4209 100644 (file)
@@ -73,8 +73,6 @@ CValue* KX_GameActuator::GetReplica()
 {
        KX_GameActuator* replica = new KX_GameActuator(*this);
        replica->ProcessReplica();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        
        return replica;
 }
index fe7f96d9fac0d117e1964010283af021530ee7c5..8bd1e00833688969ff5b7ad76fc4b00869571f48 100644 (file)
@@ -333,6 +333,8 @@ void KX_GameObject::RemoveParent(KX_Scene *scene)
 
 void KX_GameObject::ProcessReplica()
 {
+       SCA_IObject::ProcessReplica();
+       
        m_pPhysicsController1 = NULL;
        m_pGraphicController = NULL;
        m_pSGNode = NULL;
@@ -351,7 +353,6 @@ CValue* KX_GameObject::GetReplica()
        KX_GameObject* replica = new KX_GameObject(*this);
 
        // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        replica->ProcessReplica();
 
        return replica;
index fb3b0eb1dd24ebfa40c39b59231a0bc2be945aac..9ea597def1eb1772abb9c6ff77db00a88887b39c 100644 (file)
@@ -128,8 +128,6 @@ public:
        virtual CValue* GetReplica() {
                KX_IpoActuator* replica = new KX_IpoActuator(*this);//m_float,GetName());
                replica->ProcessReplica();
-               // this will copy properties and so on...
-               CValue::AddDataToReplica(replica);
                return replica;
        };
 
index a426953602bbf5a32d6f4c7c825325167260a4d4..7bc982111fe1af7745e6d65d548428166c2d746f 100644 (file)
@@ -82,9 +82,6 @@ CValue*               KX_LightObject::GetReplica()
 
        KX_LightObject* replica = new KX_LightObject(*this);
 
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-
        replica->ProcessReplica();
        
        replica->m_lightobj.m_worldmatrix = replica->GetOpenGLMatrixPtr();
index 5a9618f52b2360a06ccd5d0ca460ed662eb03649..350fda198dbb5a09db58f566162f8109069fa76a 100644 (file)
@@ -63,7 +63,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
        virtual CValue* GetReplica() {
                CValue* replica = new KX_MouseFocusSensor(*this);
                // this will copy properties and so on...
-               CValue::AddDataToReplica(replica);
+               replica->ProcessReplica();
                return replica;
        };
        /**
index ce519e1752c73ad8e12d3319b1c8e8e2a1396dd8..23c525a1b52804d0bbb8188c5dc02580eb7a4654 100644 (file)
@@ -111,8 +111,7 @@ CValue* KX_NearSensor::GetReplica()
        KX_NearSensor* replica = new KX_NearSensor(*this);
        replica->m_colliders = new CListValue();
        replica->Init();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        
        replica->m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::NEAR);
        
index ed5539709e48e7a1416ed8a3249a884e7ac2ce43..b90967d610c25c0604e821508d24ac6a4e4c6b7d 100644 (file)
@@ -253,9 +253,6 @@ CValue* KX_ObjectActuator::GetReplica()
        KX_ObjectActuator* replica = new KX_ObjectActuator(*this);//m_float,GetName());
        replica->ProcessReplica();
 
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-
        return replica;
 }
 
index 79e826704866855fd864da279e84ff3d92d27b5e..afc16ba994cd6e90636bd5ae9925fc908c1d32e0 100644 (file)
@@ -73,8 +73,6 @@ CValue* KX_ParentActuator::GetReplica()
        KX_ParentActuator* replica = new KX_ParentActuator(*this);
        // replication just copy the m_base pointer => common random generator
        replica->ProcessReplica();
-       CValue::AddDataToReplica(replica);
-
        return replica;
 }
 
index d06728c1d4d124650df3c18140e26d23a2d42f2b..d9b8b6fec5b0c2ef881f57e613c71defdde0cdbb 100644 (file)
@@ -82,8 +82,7 @@ CValue* KX_RadarSensor::GetReplica()
        KX_RadarSensor* replica = new KX_RadarSensor(*this);
        replica->m_colliders = new CListValue();
        replica->Init();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        
        replica->m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::RADAR);
        
index bee644b6a305cdb5d32a5666f3cde97f3d9ff68d..ea9356a49d12ac506cb20432a21bc487f49b1574 100644 (file)
@@ -88,8 +88,7 @@ KX_RaySensor::~KX_RaySensor()
 CValue* KX_RaySensor::GetReplica()
 {
        KX_RaySensor* replica = new KX_RaySensor(*this);
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        replica->Init();
 
        return replica;
index b5aa7a2f4c25f5d9efe4d95765f15126aa5ed8e0..dd9d63f5cd94c482815308aa8e777dfa77107970 100644 (file)
@@ -125,7 +125,6 @@ CValue* KX_SCA_AddObjectActuator::GetReplica()
 
        // this will copy properties and so on...
        replica->ProcessReplica();
-       CValue::AddDataToReplica(replica);
 
        return replica;
 }
index dd3250f5b61d64df8aff24aa12d344349573d89a..4bc42686d78cac6d0af05684f205527f76de9b0c 100644 (file)
@@ -215,10 +215,6 @@ CValue* KX_SCA_DynamicActuator::GetReplica()
                return NULL;
 
        replica->ProcessReplica();
-
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-
        return replica;
 };
 
index c0dc6ea6b5537cea17d5cda5eaeef172eb9c392d..a0b411dd3a9a1cf62b84756f9439dafd8b576e6d 100644 (file)
@@ -82,8 +82,6 @@ CValue* KX_SCA_EndObjectActuator::GetReplica()
        if (replica == NULL) return NULL;
 
        replica->ProcessReplica();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 };
 
index b7135a5503a5a72a04435d88cddd5ed32ae239fc..8b87253d0a3140e2aa4dcfbeba047b5ce5baa70f 100644 (file)
@@ -217,9 +217,6 @@ CValue* KX_SCA_ReplaceMeshActuator::GetReplica()
 
        replica->ProcessReplica();
 
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-
        return replica;
 };
 
index c525aeb1e3f15442544393fae958c7cea6c91138..6f622939dc475afefbbc942704b088c1b4180e29 100644 (file)
@@ -76,9 +76,6 @@ CValue* KX_SceneActuator::GetReplica()
 {
        KX_SceneActuator* replica = new KX_SceneActuator(*this);
        replica->ProcessReplica();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
-       
        return replica;
 }
 
index 4103da4ad93e61b90dfb55af69470cc5329fa037..db3d92ffd795194e5ee78d46351c300f24ffb1cd 100644 (file)
@@ -90,8 +90,6 @@ CValue* KX_SoundActuator::GetReplica()
                m_soundScene->AddObject(soundobj);
        }
        
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 };
 
index 16512dc66991b3442ab7d83cda7a0dc7cbb0aed1..71ffa16cb5496343d8e3764e578a5920e45bf048 100644 (file)
@@ -62,8 +62,6 @@ KX_StateActuator::GetReplica(
 {
        KX_StateActuator* replica = new KX_StateActuator(*this);
        replica->ProcessReplica();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 }
 
index 8995a0c198ac33aa76da11e60efd4d6350a7cec6..cddd018ef334f7f5d38ed0c61954fbe2f0eb9ce9 100644 (file)
@@ -144,8 +144,7 @@ CValue* KX_TouchSensor::GetReplica()
        KX_TouchSensor* replica = new KX_TouchSensor(*this);
        replica->m_colliders = new CListValue();
        replica->Init();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
+       replica->ProcessReplica();
        return replica;
 }
 
index a17147c0842f10b03a9d78f6a56653b675e1b6b0..c4cc2b1f062e2aad9946e2380b2c0e1aa4f52f41 100644 (file)
@@ -61,8 +61,6 @@ class KX_TrackToActuator : public SCA_IActuator
        virtual CValue* GetReplica() {
                KX_TrackToActuator* replica = new KX_TrackToActuator(*this);
                replica->ProcessReplica();
-               // this will copy properties and so on...
-               CValue::AddDataToReplica(replica);
                return replica;
        };
 
index 9b1849511fee165187fee70c70e87cad6d1fac8d..ed12a88ad6ad6afc0c83fd515132f5569e5987ef 100644 (file)
@@ -64,8 +64,6 @@ KX_VisibilityActuator::GetReplica(
 {
        KX_VisibilityActuator* replica = new KX_VisibilityActuator(*this);
        replica->ProcessReplica();
-       // this will copy properties and so on...
-       CValue::AddDataToReplica(replica);
        return replica;
 }