diff --git a/TMXParser.h b/TMXParser.h index b5bd402..842da34 100644 --- a/TMXParser.h +++ b/TMXParser.h @@ -127,6 +127,7 @@ class TMXParser{ while (f.good()) { std::string data; f>>data; + if (data.empty()) continue; if (accumulator.length()>0) { //We're accumulating strings until we find '>' @@ -148,6 +149,9 @@ class TMXParser{ data = data.substr(data.find(",")+1,std::string::npos); rowData.push_back(stoi(datapiece)); } + if (data.length()) { + rowData.push_back(stoi(data)); + } parsedMapInfo.LayerData[parsedMapInfo.LayerData.size()-1].tiles.push_back(rowData); } }