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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user