Fixed bug when loading challenges.xml
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10356 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
f3c9338908
commit
b384f71c7e
@ -39,12 +39,18 @@
|
||||
void Challenge::load(const XMLNode* challengesNode)
|
||||
{
|
||||
const XMLNode* node = challengesNode->getNode( m_data->getId() );
|
||||
if(node == NULL) return;
|
||||
if(node == NULL)
|
||||
{
|
||||
fprintf(stderr, "[Challenge] WARNING: Couldn't find node <%s> in XML file\n",
|
||||
m_data->getId().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
// See if the challenge is solved (it's activated later from the
|
||||
// unlock_manager).
|
||||
bool finished=false;
|
||||
node->get("solved", &finished);
|
||||
|
||||
m_state = finished ? CH_SOLVED : CH_INACTIVE;
|
||||
} // load
|
||||
|
||||
|
@ -209,7 +209,7 @@ void UnlockManager::load()
|
||||
{
|
||||
core::stringw player_name;
|
||||
xml_game_slots[n]->get("player", &player_name);
|
||||
|
||||
|
||||
GameSlot* slot = new GameSlot(player_name);
|
||||
|
||||
std::string kart_id;
|
||||
@ -223,8 +223,9 @@ void UnlockManager::load()
|
||||
{
|
||||
ChallengeData* curr = i->second;
|
||||
Challenge* state = new Challenge(curr);
|
||||
|
||||
slot->m_challenges_state[curr->getId()] = state;
|
||||
state->load(root);
|
||||
state->load(xml_game_slots[n]);
|
||||
}
|
||||
slot->computeActive();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user