1
0
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:
Tomasz Zieliński 2024-04-12 11:51:15 +02:00
parent 4fa7f0e93d
commit be9813b4fb
2 changed files with 0 additions and 44 deletions

View File

@ -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;

View File

@ -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>