1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

battlefields in VLC and custom bonuses for terrain patches

This commit is contained in:
Andrii Danylchenko
2022-06-28 11:05:30 +03:00
parent 3b1d271ae0
commit 4b4cc3cf4b
47 changed files with 645 additions and 221 deletions

View File

@ -515,10 +515,10 @@ void AObjectTypeHandler::init(const JsonNode & input, boost::optional<std::strin
else
aiValue = static_cast<boost::optional<si32>>(input["aiValue"].Integer());
if(input["battleground"].isNull())
battlefield = BattleField::NONE;
if(input["battleground"].getType() == JsonNode::JsonType::DATA_STRING)
battlefield = input["battleground"].String();
else
battlefield = BattleField(input["battleground"].String());
battlefield = boost::none;
initTypeData(input);
}
@ -577,7 +577,7 @@ std::vector<ObjectTemplate> AObjectTypeHandler::getTemplates() const
BattleField AObjectTypeHandler::getBattlefield() const
{
return battlefield;
return battlefield ? BattleField::fromString(battlefield.get()) : BattleField::NONE;
}
std::vector<ObjectTemplate> AObjectTypeHandler::getTemplates(const Terrain & terrainType) const