1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Multiple minor fixes:

- fixed starting armies of some heroes, including Bron #1602
- (debian) added vcmi-dbg package with debug information
- proper randomization of hero secondary skills, fixes #1603
- second capitol will show up as disabled immediately #1604
- proper deserialization of boost::variant
- empty file will no longer crash JsonNode parser
- fixed some compiler warnings
This commit is contained in:
Ivan Savenko
2013-12-03 09:03:37 +00:00
parent ee1b0459e6
commit 3d3f93275d
13 changed files with 157 additions and 72 deletions

View File

@ -350,7 +350,9 @@ public:
struct DLL_LINKAGE SecondarySkillsInfo
{
ui32 randomSeed; //skills are determined, initialized at map start
//skills are determined, initialized at map start
//FIXME: remove mutable?
mutable std::minstd_rand distribution;
ui8 magicSchoolCounter;
ui8 wisdomCounter;
@ -359,7 +361,21 @@ public:
template <typename Handler> void serialize(Handler &h, const int version)
{
h & randomSeed & magicSchoolCounter & wisdomCounter;
h & magicSchoolCounter & wisdomCounter;
if (h.saving)
{
std::ostringstream stream;
stream << distribution;
std::string str = stream.str();
h & str;
}
else
{
std::string str;
h & str;
std::istringstream stream(str);
stream >> distribution;
}
}
} skillsInfo;