Skip to content

Commit

Permalink
fixed crashbug
Browse files Browse the repository at this point in the history
  • Loading branch information
AssassinTee committed Jan 30, 2019
1 parent 6e7a7b9 commit 0837db8
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/game/server/wave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,24 @@ std::vector<int> CWave::GetZombNum(int wave)
std::string wave_str= std::to_string(wave);
json waves = m_Json.at("Waves");
//GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "debug", aBuf);
json curwave = waves.at(wave_str);
if(true)

json j = waves[wave_str];
if(!j.is_object())
{
return GetEndlessWave();
}
//if(j.is_object()){
std::vector<int> result;
for(int i = 0; i < 13; ++i)
{
json j = curwave;//*it;
std::vector<int> result;
for(int i = 0; i < 13; ++i)
{
result.push_back(j.value(m_JsonZombieNames[i], 0));
}
return result;
result.push_back(j.value(m_JsonZombieNames[i], 0));
}
return result;
/*}
else
{
return GetEndlessWave();
}*/
}

std::vector<int> CWave::GetEndlessWave()
Expand Down

0 comments on commit 0837db8

Please sign in to comment.