diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-08-16 16:42:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-08-16 16:42:34 +0400 |
commit | a5d414c29855cc4f999b28781393bcee036950ff (patch) | |
tree | 437c6f2e0d31fef3c21c218f6ca0dfb237e1b3d4 /source/gameengine/Converter/KX_ConvertSensors.cpp | |
parent | 1ffede887211c748d4426d6e68f179dac5a5bcfd (diff) |
warning message for when sensors loose their controllers, has been a problem recently with linking in groups that contain game logic.
- also useful for testing bug [#17485] Sensors lost when loading objects from a group (apricot showstopper)
Diffstat (limited to 'source/gameengine/Converter/KX_ConvertSensors.cpp')
-rw-r--r-- | source/gameengine/Converter/KX_ConvertSensors.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 5e433bb821b..76a12fb7f42 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -741,10 +741,24 @@ void BL_ConvertSensors(struct Object* blenderobject, for (int i=0;i<sens->totlinks;i++) { bController* linkedcont = (bController*) sens->links[i]; - SCA_IController* gamecont = converter->FindGameController(linkedcont); + if (linkedcont) { + SCA_IController* gamecont = converter->FindGameController(linkedcont); - if (gamecont) { - logicmgr->RegisterToSensor(gamecont,gamesensor); + if (gamecont) { + logicmgr->RegisterToSensor(gamecont,gamesensor); + } else { + printf( + "Warning, sensor \"%s\" could not find its controller" + "(link %d of %d)\n" + "\tthere has been an error converting the blender controller for the game engine," + "logic may be incorrect\n", sens->name, i+1, sens->totlinks); + } + } else { + printf( + "Warning, sensor \"%s\" has lost a link to a controller" + "(link %d of %d)\n" + "\tpossible causes are partially appended objects or an error reading the file," + "logic may be incorrect\n", sens->name, i+1, sens->totlinks); } } // done with gamesensor |