From ca9bf74cba10d67f4d8da670b2a1471a2e0df23b Mon Sep 17 00:00:00 2001 From: hikerstk Date: Fri, 12 Feb 2010 02:28:52 +0000 Subject: [PATCH] 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 --- src/items/item.cpp | 6 ++++-- src/items/item_manager.hpp | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/items/item.cpp b/src/items/item.cpp index 2b4c148d6..0a9a0a12c 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -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); diff --git a/src/items/item_manager.hpp b/src/items/item_manager.hpp index f755f4f86..54e816bb0 100644 --- a/src/items/item_manager.hpp +++ b/src/items/item_manager.hpp @@ -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 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();