void chkversion(std::istream & fin) { if ( fin.peek() == '#' ) { std::string vline; getline(fin, vline); std::string tmphash, tmpver; int savedver=-1; std::stringstream vliness(vline); vliness >> tmphash >> tmpver >> savedver; if ( tmpver == "version" && savedver != -1 ) { savegame_loading_version = savedver; } }
void mapbuffer::unserialize(std::ifstream & fin) { std::map<tripoint, submap*>::iterator it; int itx, ity, t, d, a, num_submaps, num_loaded = 0; item it_tmp; std::string databuff; if ( fin.peek() == '#' ) { std::string vline; getline(fin, vline); std::string tmphash, tmpver; int savedver=-1; std::stringstream vliness(vline); vliness >> tmphash >> tmpver >> savedver; if ( tmpver == "version" && savedver != -1 ) { savegame_loading_version = savedver; } }