1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* fixed vector<bool> serialization

* fixed issue with loading castle event
This commit is contained in:
Michał W. Urbańczyk 2013-02-05 14:32:59 +00:00
parent 937b316c11
commit f8d7473f9a
2 changed files with 2 additions and 7 deletions

View File

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

View File

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