diff options
author | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-10-29 14:05:06 +0300 |
---|---|---|
committer | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-10-29 14:14:40 +0300 |
commit | 8d3d931f6a6401b44a23357839f498fdb7f24e36 (patch) | |
tree | b09fc1d095f7dbab279589e0afcf36901607d1b5 /source/gameengine/Converter/KX_ConvertActuators.cpp | |
parent | 0e80d0893fac47f04f2a06e6d484bddad87ae5d3 (diff) |
BGE: Fix T46338 replace mesh from an other scene.
To make consistent with KX_GameObject.replaceMesh, we don't allow this behavior but print an error message for the replace mesh actuator.
e.g : Warning: object "Cube" from ReplaceMesh actuator "Edit Object" uses a mesh not owned by an object in scene "scene1"
Reviewers: youle.
Diffstat (limited to 'source/gameengine/Converter/KX_ConvertActuators.cpp')
-rw-r--r-- | source/gameengine/Converter/KX_ConvertActuators.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 3347255f6f6..12bfb11032b 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -505,6 +505,13 @@ void BL_ConvertActuators(const char* maggiename, { RAS_MeshObject *tmpmesh = converter->FindGameMesh(editobact->me); + if (!tmpmesh) { + std::cout << "Warning: object \"" << objectname << + "\" from ReplaceMesh actuator \"" << uniquename << + "\" uses a mesh not owned by an object in scene \"" << + scene->GetName() << "\"." << std::endl; + } + KX_SCA_ReplaceMeshActuator* tmpreplaceact = new KX_SCA_ReplaceMeshActuator( gameobj, tmpmesh, |