1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Redone RMG template serialization using JSON serializer, added tests

This commit is contained in:
AlexVinS
2018-03-09 21:11:20 +03:00
parent 7d27d144a5
commit 9d108d59db
25 changed files with 991 additions and 718 deletions

View File

@@ -406,8 +406,8 @@ const CRmgTemplate * CMapGenOptions::getPossibleTemplate(CRandomGenerator & rand
for(const auto & tplPair : tpls)
{
const auto & tpl = tplPair.second;
CRmgTemplate::CSize tplSize(width, height, hasTwoLevels);
if(tplSize >= tpl->getMinSize() && tplSize <= tpl->getMaxSize())
int3 tplSize(width, height, (hasTwoLevels ? 2 : 1));
if(tpl->matchesSize(tplSize))
{
bool isPlayerCountValid = false;
if (getPlayerCount() != RANDOM_SIZE)