Sfoglia il codice sorgente

* fixed vector<bool> serialization
* fixed issue with loading castle event

Michał W. Urbańczyk 12 anni fa
parent
commit
f8d7473f9a
2 ha cambiato i file con 2 aggiunte e 7 eliminazioni
  1. 2 2
      lib/Connection.h
  2. 0 5
      lib/Mapping/MapFormatH3M.cpp

+ 2 - 2
lib/Connection.h

@@ -752,7 +752,7 @@ public:
 	void saveBooleanVector(const std::vector<bool> & data)
 	{
 		std::vector<ui8> convData;
-		std::copy(data.begin(), data.end(), convData.begin());
+		std::copy(data.begin(), data.end(), std::back_inserter(convData));
 		saveSerializable(convData);
 	}
 };
@@ -1133,7 +1133,7 @@ public:
 	{
 		std::vector<ui8> convData;
 		loadSerializable(convData);
-		std::copy(convData.begin(), convData.end(), data.begin());
+		std::copy(convData.begin(), convData.end(), std::back_inserter(data));
 	}
 };
 

+ 0 - 5
lib/Mapping/MapFormatH3M.cpp

@@ -2012,11 +2012,6 @@ CGTownInstance * CMapLoaderH3M::readTown(int castleID)
 
 		readResourses(nce->resources);
 
-		for(int x = 0; x < 7; ++x)
-		{
-			nce->resources[x] = readUI32();
-		}
-
 		nce->players = readUI8();
 		if(map->version > EMapFormat::AB)
 		{