Fixed rules parsing on Windows

This commit is contained in:
Xawotihs
2011-10-01 15:06:24 +00:00
parent b36653787e
commit d47ece1202

View File

@@ -112,32 +112,30 @@ RulesState::RulesState()
void RulesState::parsePlayerState(int playerId, string s)
{
stringstream stream(s);
streampos pos = stream.tellg();
stream >> *(playerData[playerId].player);
while(std::getline(stream, s))
size_t limiter = s.find("=");
if (limiter == string::npos) limiter = s.find(":");
string areaS;
if (limiter != string::npos)
{
size_t limiter = s.find("=");
if (limiter == string::npos) limiter = s.find(":");
string areaS;
if (limiter != string::npos)
{
areaS = s.substr(0, limiter);
areaS = s.substr(0, limiter);
if (areaS.compare("auto") == 0)
{
playerData[playerId].extraRules.push_back(s.substr(limiter + 1));
return;
}
else
{
return; // ERROR
}
if (areaS.compare("auto") == 0)
{
playerData[playerId].extraRules.push_back(s.substr(limiter + 1));
return;
}
else
{
//ERROR
return; // ERROR
}
}
else
{
//ERROR
}
}
void Rules::addExtraRules(GameObserver* g)