BGE patch: Relink actuators with target within group when duplicating group; generali...
authorBenoit Bolsee <benoit.bolsee@online.be>
Sat, 19 Jul 2008 07:45:19 +0000 (07:45 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sat, 19 Jul 2008 07:45:19 +0000 (07:45 +0000)
commit9ed079bf5cbe8a5a371190a8dedec970bcbd3ac2
tree7f32f799d89c308743a7e3fdf74cd5bc8f168415
parent5e2ee191877d1073a20da32c52d9e97cfab8f5c8
BGE patch: Relink actuators with target within group when duplicating group; generalize protection against object deletion for all actuators that point to objects.

Certain actuators hold a pointer to an objects: Property,
SceneCamera, AddObject, Camera, Parent, TractTo. When a
group is duplicated, the actuators that point to objects
within the group will be relinked to point to the
replicated objects and not to the original objects.
This helps to setup self-contained group with a camera
following a character for example.
This feature also works when adding a single object
(and all its children) with the AddObject actuator.

The second part of the patch extends the protection
against object deletion to all the actuators of the above
list (previously, only the TrackTo, AddObject and
Property actuators were protected). In case the target
object of these actuators is deleted, the BGE won't
crash.
18 files changed:
source/gameengine/Converter/BL_DeformableGameObject.h
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertyActuator.h
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_CameraActuator.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_ParentActuator.h
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_SceneActuator.h
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_TrackToActuator.h