Fixes several minor initialization issues that were causing problems with deletion/management of components and entities.

Also makes the ThirdPersonPlayer game object editor selectable again by removing an erroneously set field.
This commit is contained in:
Areloch 2016-05-31 12:51:23 -05:00
parent bbf7865a77
commit 2464b620ba
7 changed files with 46 additions and 9 deletions

View file

@ -92,6 +92,32 @@ void CameraOrbiterComponent::onComponentRemove()
Parent::onComponentRemove();
}
void CameraOrbiterComponent::componentAddedToOwner(Component *comp)
{
if (comp->getId() == getId())
return;
//test if this is a shape component!
CameraComponent *camComponent = dynamic_cast<CameraComponent*>(comp);
if (camComponent)
{
mCamera = camComponent;
}
}
void CameraOrbiterComponent::componentRemovedFromOwner(Component *comp)
{
if (comp->getId() == getId()) //?????????
return;
//test if this is a shape component!
CameraComponent *camComponent = dynamic_cast<CameraComponent*>(comp);
if (camComponent)
{
mCamera = NULL;
}
}
U32 CameraOrbiterComponent::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
{
U32 retMask = Parent::packUpdate(con, mask, stream);