mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
battlefields in VLC and custom bonuses for terrain patches
This commit is contained in:
@ -25,6 +25,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "mapObjects/CObjectClassesHandler.h"
|
||||
#include "BattleFieldHandler.h"
|
||||
|
||||
CHero::CHero() = default;
|
||||
CHero::~CHero() = default;
|
||||
@ -179,8 +180,10 @@ std::vector<BattleHex> CObstacleInfo::getBlocked(BattleHex hex) const
|
||||
|
||||
bool CObstacleInfo::isAppropriate(const Terrain & terrainType, const BattleField & battlefield) const
|
||||
{
|
||||
if(battlefield.isSpecial())
|
||||
return vstd::contains(allowedSpecialBfields, battlefield);
|
||||
auto bgInfo = battlefield.getInfo();
|
||||
|
||||
if(bgInfo->isSpecial)
|
||||
return vstd::contains(allowedSpecialBfields, bgInfo->identifier);
|
||||
|
||||
return vstd::contains(allowedTerrains, terrainType);
|
||||
}
|
||||
|
Reference in New Issue
Block a user