Several more map read/write test cases

This commit is contained in:
2015-09-04 04:26:58 -04:00
parent 15aeaf8876
commit 8bc8e10075
10 changed files with 318 additions and 6 deletions

View File

@@ -1902,11 +1902,8 @@ void loadTownMapData(map_data&& data, int which, cScenario& scen) {
bool is_boat = false;
cVehicle* what;
switch(feat.first) {
// Special values
case eMapFeature::NONE:
break;
// Outdoor-only features
case eMapFeature::TOWN: break;
case eMapFeature::NONE: break; // Special value
case eMapFeature::TOWN: break; // Outdoor-only feature
case eMapFeature::SPECIAL_NODE:
town.special_locs.push_back({x, y, feat.second});
break;

View File

@@ -19,9 +19,11 @@ map_data load_map(std::istream& fin, bool isTown, std::string name) {
map_data data;
data.file = name;
int row = 0;
while(!fin.eof()) {
while(fin) {
std::string line;
getline(fin, line);
if(line.empty() && !fin.eof())
continue;
int n = 0, col = 0;
eMapFeature curFeature = eMapFeature::NONE;
// vehicle_owned = true means the party owns it