Bugfix: if a bubble gum was dropped while items were switched, stk could crash.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4724 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-02-15 02:44:39 +00:00
parent 2f1c755596
commit dfa152cd3b

View File

@ -77,11 +77,12 @@ void Item::switchTo(ItemType type, scene::IMesh *mesh)
*/
void Item::switchBack()
{
// FIXME: debug only - printf to be able to set a breakpoint.
// If the item is not switched, do nothing. This can happen if a bubble
// gum is dropped while items are switched - when switching back, this
// bubble gum has no original type.
if(m_original_type==ITEM_NONE)
printf("XX item none inside switchBack item=%d switch_time=%f\n",
m_type, item_manager->m_switch_time);
//assert(m_original_type!=ITEM_NONE);
return;
setType(m_original_type);
m_original_type = ITEM_NONE;
m_node->setMesh(m_original_mesh);