1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Next part of town configuration:

- town screen is mostly implemented, has some minor issues
- factions are now separate from towns, neutrals have faction with id=9
- more constants to GameConstants: town-specific buildings, strings for terrains and resources
- replaced most access to builtBuildings with isBuilt() method
- replaced id's with enums for town subtype and buildings id's
This commit is contained in:
Ivan Savenko
2012-09-05 12:49:23 +00:00
parent 44cc848edc
commit 0ca9f64573
36 changed files with 1475 additions and 1471 deletions

View File

@@ -5,7 +5,7 @@
#include "Filesystem/CResourceLoader.h"
#include "VCMI_Lib.h"
#include "CGameState.h"
#include "CHeroHandler.h"
#include "CTownHandler.h"
#include "CModHandler.h"
using namespace boost::assign;
@@ -148,11 +148,9 @@ std::string CCreature::nodeName() const
bool CCreature::isItNativeTerrain(int terrain) const
{
if(!vstd::iswithin(faction, 0, 9))
return false;
assert(vstd::contains(VLC->townh->factions, faction));
//not good handler dependency
return VLC->heroh->nativeTerrains[faction] == terrain;
return VLC->townh->factions[faction].nativeTerrain == terrain;
}
int readNumber(int & befi, int & i, int andame, std::string & buf) //helper function for void CCreatureHandler::loadCreatures() and loadUnitAnimInfo()