mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
- fixed uninitialized pointer
This commit is contained in:
@ -56,6 +56,30 @@ si32 CBuilding::getDistance(BuildingID buildID) const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CFaction::CFaction()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CFaction::~CFaction()
|
||||||
|
{
|
||||||
|
delete town;
|
||||||
|
}
|
||||||
|
|
||||||
|
CTown::CTown()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CTown::~CTown()
|
||||||
|
{
|
||||||
|
BOOST_FOREACH(auto build, buildings)
|
||||||
|
build.second.dellNull();
|
||||||
|
|
||||||
|
BOOST_FOREACH(CStructure * str, clientInfo.structures)
|
||||||
|
delete str;
|
||||||
|
}
|
||||||
|
|
||||||
CTownHandler::CTownHandler()
|
CTownHandler::CTownHandler()
|
||||||
{
|
{
|
||||||
VLC->townh = this;
|
VLC->townh = this;
|
||||||
@ -554,6 +578,9 @@ CFaction * CTownHandler::loadFromJson(const JsonNode &source)
|
|||||||
faction->town->faction = faction;
|
faction->town->faction = faction;
|
||||||
loadTown(*faction->town, source["town"]);
|
loadTown(*faction->town, source["town"]);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
faction->town = nullptr;
|
||||||
|
|
||||||
if (!source["puzzleMap"].isNull())
|
if (!source["puzzleMap"].isNull())
|
||||||
loadPuzzle(*faction, source["puzzleMap"]);
|
loadPuzzle(*faction, source["puzzleMap"]);
|
||||||
|
|
||||||
|
@ -97,6 +97,9 @@ struct DLL_LINKAGE SPuzzleInfo
|
|||||||
class CFaction
|
class CFaction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
CFaction();
|
||||||
|
~CFaction();
|
||||||
|
|
||||||
std::string name; //town name, by default - from TownName.txt
|
std::string name; //town name, by default - from TownName.txt
|
||||||
|
|
||||||
TFaction index;
|
TFaction index;
|
||||||
@ -122,6 +125,9 @@ public:
|
|||||||
class DLL_LINKAGE CTown
|
class DLL_LINKAGE CTown
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
CTown();
|
||||||
|
~CTown();
|
||||||
|
|
||||||
CFaction * faction;
|
CFaction * faction;
|
||||||
|
|
||||||
std::vector<std::string> names; //names of the town instances
|
std::vector<std::string> names; //names of the town instances
|
||||||
|
Reference in New Issue
Block a user