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::stringcolumn="";
std::vector<std::string>data;
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...
//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);
ScrollProdRecipes.reserve(300);
CompRecipes.reserve(300);
CompRecipes.reserve(300);
DecompRecipes.reserve(300);
DecompRecipes.reserve(300);
for(inti=0;i<fileContents.size();i++){
while(file.good()){
if(fileContents[i]=='\t'){
std::stringline;
std::getline(file,line);
for(inti=0;i<line.size();i++){
if(line[i]=='\t'){
data.push_back(column);
data.push_back(column);
column="";
column="";
}else
}else{
if(fileContents[i]=='\n'){
column+=line[i];
}
}
data.push_back(column);
data.push_back(column);
column="";
column="";
if(data.size()!=25){
if(data.size()!=25){
@ -357,22 +360,23 @@ public:
}
}
data.clear();
data.clear();
}else{
column+=fileContents[i];
}
}
}
file=std::ifstream("assets/ItemViewinfo.txt");
file.close();
fileContents=slurp(file);
file=std::ifstream("assets/ItemViewInfo.txt");
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.