Fixed crash when installing a new addon.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7284 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-05 22:20:52 +00:00
parent b582266424
commit de50274e96

View File

@ -203,9 +203,14 @@ void AddonsManager::install(const Addon &addon)
// This is important on one hand since we reload all karts (this
// function is easily available) and existing karts will not reload
// their meshes.
const KartProperties *prop = kart_properties_manager->getKart(addon.getId());
const KartModel &model = prop->getMasterKartModel();
irr_driver->removeMesh(model.getModel());
const KartProperties *prop =
kart_properties_manager->getKart(addon.getId());
// If the model already exist (i.e. it's an update, not a new install
if(prop)
{
const KartModel &model = prop->getMasterKartModel();
irr_driver->removeMesh(model.getModel());
}
}
saveInstalled();
} // install