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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user