mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	protect save_map_bin and load_map_bin from possible lacking base
This commit is contained in:
		| @@ -808,6 +808,7 @@ bool save_map(const string& fname) { | ||||
|   } | ||||
|  | ||||
| EX void save_map_bin(hstream& f) { | ||||
|   if(!base) { f.write<short>(-1); return; } | ||||
|   auto& all = base->allcells(); | ||||
|   int origcells = 0; | ||||
|   for(cellinfo& ci: cells) | ||||
| @@ -867,6 +868,7 @@ bool load_map(const string &fname) { | ||||
| EX void load_map_bin(hstream& f) { | ||||
|   auto& all = base->allcells(); | ||||
|   eGeometry g = (eGeometry) f.get<short>(); | ||||
|   if(int(g) == -1) return; | ||||
|   int sa = f.get<short>(); | ||||
|   cellcount = f.get<short>(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue