From a7d62553f1c4605272c7cda8642e69f0eb3e7f81 Mon Sep 17 00:00:00 2001 From: deveee Date: Mon, 14 Oct 2013 19:40:10 +0000 Subject: [PATCH] Fixed crash in new race result gui in soccer mode git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14253 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/states_screens/race_result_gui.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index a3ab9c967..aae140d2d 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -915,10 +915,8 @@ void RaceResultGUI::displaySoccerResults() resultText.append(StringUtils::timeToString(scoreTimes.at(i)).c_str()); pos = core::rect(currX,currY,currX,currY); font->draw(resultText,pos, color, true, false); - std::string iconFile = soccerWorld->getKart(scorers.at(i))-> - getKartProperties()->getAbsoluteIconFile(); - iconFile = iconFile.substr(iconFile.find("..")); - scorerIcon = irr_driver->getTexture(file_manager->getTextureFile(iconFile.c_str())); + scorerIcon = soccerWorld->getKart(scorers.at(i))-> + getKartProperties()->getIconMaterial()->getTexture(); sourceRect = core::recti(core::vector2di(0,0), scorerIcon->getSize()); irr::u32 offsetX = GUIEngine::getFont()->getDimension(resultText.c_str()).Width/2; destRect = core::recti(currX-offsetX-30, currY, currX-offsetX, currY+ 30); @@ -940,10 +938,8 @@ void RaceResultGUI::displaySoccerResults() resultText.append(StringUtils::timeToString(scoreTimes.at(i)).c_str()); pos = core::rect(currX,currY,currX,currY); font->draw(resultText,pos, color, true, false); - std::string iconFile = soccerWorld->getKart(scorers.at(i))-> - getKartProperties()->getAbsoluteIconFile(); - iconFile = iconFile.substr(iconFile.find("..")); - scorerIcon = irr_driver->getTexture(file_manager->getTextureFile(iconFile)); + scorerIcon = soccerWorld->getKart(scorers.at(i))-> + getKartProperties()->getIconMaterial()->getTexture(); sourceRect = core::recti(core::vector2di(0,0), scorerIcon->getSize()); irr::u32 offsetX = GUIEngine::getFont()->getDimension(resultText.c_str()).Width/2;