Added some debug output to find reason for assert.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4690 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-02-12 02:28:52 +00:00
parent 10116f628b
commit ca9bf74cba
2 changed files with 9 additions and 6 deletions

View File

@ -20,6 +20,7 @@
#include "items/item.hpp"
#include "graphics/irr_driver.hpp"
#include "items/item_manager.hpp" // FIXME: DEBUG ONLY
#include "karts/kart.hpp"
#include "utils/constants.hpp"
#include "utils/coord.hpp"
@ -78,8 +79,9 @@ void Item::switchBack()
{
// FIXME: debug only - printf to be able to set a breakpoint.
if(m_original_type==ITEM_NONE)
printf("XX item none inside switchBack\n");
assert(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);
setType(m_original_type);
m_original_type = ITEM_NONE;
m_node->setMesh(m_original_mesh);

View File

@ -44,10 +44,6 @@ private:
std::string m_user_filename;
/** Remaining time that items should remain switched. If the
* value is <0, it indicates that the items are not switched atm. */
float m_switch_time;
/** What item is item is switched to. */
std::vector<Item::ItemType> m_switch_to;
@ -55,6 +51,11 @@ private:
Item::ItemType type);
public:
// DEBUG only, this variable should become private again.
/** Remaining time that items should remain switched. If the
* value is <0, it indicates that the items are not switched atm. */
float m_switch_time;
ItemManager();
~ItemManager();
void loadDefaultItems();