1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

moatHexes: use initializer list and update comment

This commit is contained in:
Arseniy Shestakov 2016-01-29 19:25:25 +03:00
parent 8c39ecf538
commit 75f278b913

View File

@ -88,8 +88,8 @@ CTown::~CTown()
std::vector<BattleHex> CTown::defaultMoatHexes()
{
static const BattleHex moatHexes[] = {11, 28, 44, 61, 77, 111, 129, 146, 164, 181};
return std::vector<BattleHex>(moatHexes, moatHexes + ARRAY_COUNT(moatHexes));
static const std::vector<BattleHex> moatHexes = {11, 28, 44, 61, 77, 111, 129, 146, 164, 181};
return moatHexes;
}
CTownHandler::CTownHandler()
@ -549,7 +549,7 @@ void CTownHandler::loadTown(CTown &town, const JsonNode & source)
town.moatDamage = source["moatDamage"].Float();
// Mods Compatability for pre 0.99
// Compatability for <= 0.98f mods
if(source["moatHexes"].isNull())
{
town.moatHexes = CTown::defaultMoatHexes();