fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
std::stringcolumn="";
std::vector<std::string>data;
//HACK ALERT! If the number of recipes for any of these exceeds 300, a reallocation occurs and all pointers move...
@ -315,12 +313,17 @@ public:
ScrollProdRecipes.reserve(300);
CompRecipes.reserve(300);
DecompRecipes.reserve(300);
for(inti=0;i<fileContents.size();i++){
if(fileContents[i]=='\t'){
while(file.good()){
std::stringline;
std::getline(file,line);
for(inti=0;i<line.size();i++){
if(line[i]=='\t'){
data.push_back(column);
column="";
}else
if(fileContents[i]=='\n'){
}else{
column+=line[i];
}
}
data.push_back(column);
column="";
if(data.size()!=25){
@ -357,22 +360,23 @@ public:
}
data.clear();
}else{
column+=fileContents[i];
}
}
file=std::ifstream("assets/ItemViewinfo.txt");
fileContents=slurp(file);
fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.