BGE bug fix (good for 2.47): radar and near sensor did not filter correctly the collisioning objects based on ACTOR flag when the parent object was added dynamically. This could result in a very big performance decrease.

This commit is contained in:
Benoit Bolsee 2008-07-15 18:57:10 +00:00
parent 4c48b4846e
commit e433719f51
2 changed files with 5 additions and 3 deletions

@ -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);
}

@ -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!