1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fixed CID 1375705, CID 1375709, CID 1375708

This commit is contained in:
AlexVinS 2017-05-28 14:23:02 +03:00
parent 7a1dd7bd7d
commit a7ed27c73f
2 changed files with 22 additions and 3 deletions

View File

@ -25,6 +25,18 @@
std::vector<const CArtifact *> CGTownInstance::merchantArtifacts;
std::vector<int> CGTownInstance::universitySkills;
CSpecObjInfo::CSpecObjInfo():
owner(nullptr)
{
}
CCreGenAsCastleInfo::CCreGenAsCastleInfo():
CSpecObjInfo(), asCastle(false),identifier(0)
{
}
void CCreGenAsCastleInfo::serializeJson(JsonSerializeFormat & handler)
{
handler.serializeString("sameAsTown", instanceId);
@ -52,6 +64,13 @@ void CCreGenAsCastleInfo::serializeJson(JsonSerializeFormat & handler)
}
}
CCreGenLeveledInfo::CCreGenLeveledInfo():
CSpecObjInfo(),
minLevel(0), maxLevel(7)
{
}
void CCreGenLeveledInfo::serializeJson(JsonSerializeFormat & handler)
{
handler.serializeInt("minLevel", minLevel, ui8(1));

View File

@ -23,7 +23,7 @@ class CGDwelling;
class DLL_LINKAGE CSpecObjInfo
{
public:
CSpecObjInfo() = default;
CSpecObjInfo();
virtual ~CSpecObjInfo() = default;
virtual void serializeJson(JsonSerializeFormat & handler) = 0;
@ -34,7 +34,7 @@ public:
class DLL_LINKAGE CCreGenAsCastleInfo : public virtual CSpecObjInfo
{
public:
CCreGenAsCastleInfo() = default;
CCreGenAsCastleInfo();
bool asCastle;
ui32 identifier;//h3m internal identifier
@ -47,7 +47,7 @@ public:
class DLL_LINKAGE CCreGenLeveledInfo : public virtual CSpecObjInfo
{
public:
CCreGenLeveledInfo() = default;
CCreGenLeveledInfo();
ui8 minLevel, maxLevel; //minimal and maximal level of creature in dwelling: <1, 7>
void serializeJson(JsonSerializeFormat & handler) override;