Give nolok his special bubblegum

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11546 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-09-05 01:16:01 +00:00
parent 718a90e009
commit af219c1672
5 changed files with 12 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -72,6 +72,8 @@ public:
ITEM_NITRO_BIG,
ITEM_NITRO_SMALL,
ITEM_BUBBLEGUM,
ITEM_BUBBLEGUM_NOLOK,
/** An invisible item that can be used to trigger some behavior when
* approaching a point
*/

View File

@ -78,6 +78,8 @@ void ItemManager::loadDefaultItemMeshes()
item_names[Item::ITEM_NITRO_SMALL] = "nitro-small";
item_names[Item::ITEM_TRIGGER ] = "trigger";
item_names[Item::ITEM_BUBBLEGUM_NOLOK] = "bubblegum-nolok";
const std::string file_name = file_manager->getDataFile("items.xml");
const XMLNode *root = file_manager->createXMLTree(file_name);
for(unsigned int i=Item::ITEM_FIRST; i<=Item::ITEM_LAST; i++)
@ -238,8 +240,14 @@ void ItemManager::insertItem(Item *item)
Item* ItemManager::newItem(Item::ItemType type, const Vec3& xyz,
const Vec3 &normal, AbstractKart *parent)
{
Item* item = new Item(type, xyz, normal, m_item_mesh[type],
m_item_lowres_mesh[type]);
Item::ItemType mesh_type = type;
if (type == Item::ITEM_BUBBLEGUM && parent->getIdent() == "nolok")
{
mesh_type = Item::ITEM_BUBBLEGUM_NOLOK;
}
Item* item = new Item(type, xyz, normal, m_item_mesh[mesh_type],
m_item_lowres_mesh[mesh_type]);
insertItem(item);
if(parent != NULL) item->setParent(parent);