mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-03 14:52:11 +02:00
Remove temporary workaround
This commit is contained in:
parent
4fa7f0e93d
commit
be9813b4fb
@ -36,45 +36,6 @@ bool CObstacleConstructor::isStaticObject()
|
||||
return true;
|
||||
}
|
||||
|
||||
void CObstacleConstructor::initTypeData(const JsonNode & input)
|
||||
{
|
||||
if (!input["biome"].isNull())
|
||||
{
|
||||
obstacleType = ObstacleSet::typeFromString(input["biome"]["objectType"].String());
|
||||
}
|
||||
else
|
||||
{
|
||||
obstacleType = ObstacleSet::EObstacleType::INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
void CObstacleConstructor::afterLoadFinalization()
|
||||
{
|
||||
if (obstacleType == ObstacleSet::EObstacleType::INVALID)
|
||||
return;
|
||||
|
||||
auto templates = getTemplates();
|
||||
logGlobal->info("Loaded %d templates for %s", templates.size(), getJsonKey());
|
||||
if (!templates.empty())
|
||||
{
|
||||
auto terrains = templates.front()->getAllowedTerrains();
|
||||
|
||||
// FIXME: 0 terrains
|
||||
logGlobal->info("Found %d terrains for %s", terrains.size(), getJsonKey());
|
||||
// For now assume that all templates are from the same biome
|
||||
for (auto terrain : terrains)
|
||||
{
|
||||
std::shared_ptr<ObstacleSet> os = std::make_shared<ObstacleSet>(obstacleType, terrain);
|
||||
for (auto tmpl : templates)
|
||||
{
|
||||
os->addObstacle(tmpl);
|
||||
}
|
||||
VLC->biomeHandler->addObstacleSet(os);
|
||||
logGlobal->info("Loaded obstacle set from mod %s, terrain: %s", getJsonKey(), terrain.encode(terrain.getNum()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CreatureInstanceConstructor::hasNameTextID() const
|
||||
{
|
||||
return true;
|
||||
|
@ -29,17 +29,12 @@ class CBank;
|
||||
class CGBoat;
|
||||
class CFaction;
|
||||
class CStackBasicDescriptor;
|
||||
class ObstacleSet;
|
||||
|
||||
class CObstacleConstructor : public CDefaultObjectTypeHandler<CGObjectInstance>
|
||||
{
|
||||
public:
|
||||
bool isStaticObject() override;
|
||||
void initTypeData(const JsonNode & input) override;
|
||||
void afterLoadFinalization() override;
|
||||
|
||||
protected:
|
||||
ObstacleSet::EObstacleType obstacleType;
|
||||
};
|
||||
|
||||
class CreatureInstanceConstructor : public CDefaultObjectTypeHandler<CGCreature>
|
||||
|
Loading…
x
Reference in New Issue
Block a user