*** ERROR: Internal Ogre3D exception: OGRE EXCEPTION(2:InvalidParametersException): Node 'Knight_006_node' already was a child of 'Creature_scene_node'. in Node::addChild at /home/carlos/.ogre/OgreMain/src/OgreNode.cpp (line 309)
I've found it is caused by the RenderManager::rrAttachTile( const RenderRequest& renderRequest) method, which I think is called when a creature is to be shown on screen.
How to reproduce this bug:
Pick up a creature, drop it, pick it up again and drop it rapidly on the same tile. The game crashes with the error above. I think this only happens if you do it on a tile that is not shown when first loading the level, that is, you have to scroll the screen, but I'm not sure.
By debugging the code I found that when this bug happens the situation is something like this. The scene node of the creature is a child of "Creature_scene_node" but then we try to assign the creature node as a child of "Hand_node". In the documentation of the addChild method ([url link=http://www.ogre3d.org/docs/api/html/classOgre_1_1Node.html#ad3d47c3e2b3fa5deab934b93666c7f3d"]here[/link]) it's said that the node we are trying to attach as a child must be detached from it's current parent before.
Any ideas on how to fix this? I've tried creatureNode->getParentSceneNode()->removeChild(creatureNode), but this causes a segmentation fault
Find attached the stack trace from gdb and the error output.