mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- fixed uninitialized pointer
This commit is contained in:
parent
c6cc6e6301
commit
2ea1051395
@ -56,6 +56,30 @@ si32 CBuilding::getDistance(BuildingID buildID) const
|
||||
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()
|
||||
{
|
||||
VLC->townh = this;
|
||||
@ -554,6 +578,9 @@ CFaction * CTownHandler::loadFromJson(const JsonNode &source)
|
||||
faction->town->faction = faction;
|
||||
loadTown(*faction->town, source["town"]);
|
||||
}
|
||||
else
|
||||
faction->town = nullptr;
|
||||
|
||||
if (!source["puzzleMap"].isNull())
|
||||
loadPuzzle(*faction, source["puzzleMap"]);
|
||||
|
||||
|
@ -97,6 +97,9 @@ struct DLL_LINKAGE SPuzzleInfo
|
||||
class CFaction
|
||||
{
|
||||
public:
|
||||
CFaction();
|
||||
~CFaction();
|
||||
|
||||
std::string name; //town name, by default - from TownName.txt
|
||||
|
||||
TFaction index;
|
||||
@ -122,6 +125,9 @@ public:
|
||||
class DLL_LINKAGE CTown
|
||||
{
|
||||
public:
|
||||
CTown();
|
||||
~CTown();
|
||||
|
||||
CFaction * faction;
|
||||
|
||||
std::vector<std::string> names; //names of the town instances
|
||||
|
Loading…
Reference in New Issue
Block a user