1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

CMapLoaderH3M: support for patrol initialPos in readHero

This commit is contained in:
ArseniyShestakov
2015-11-27 11:34:03 +03:00
parent 5d2e47faba
commit d6a142ca3d
2 changed files with 4 additions and 3 deletions

View File

@@ -1060,7 +1060,7 @@ void CMapLoaderH3M::readObjects()
case Obj::RANDOM_HERO:
case Obj::PRISON:
{
nobj = readHero(idToBeGiven);
nobj = readHero(idToBeGiven, objPos);
break;
}
case Obj::MONSTER: //Monster
@@ -1549,7 +1549,7 @@ void CMapLoaderH3M::readCreatureSet(CCreatureSet * out, int number)
out->validTypes(true);
}
CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven)
CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven, const int3 & initialPos)
{
auto nhi = new CGHeroInstance();
@@ -1658,6 +1658,7 @@ CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven)
else
{
nhi->patrol.patrolling = true;
nhi->patrol.initialPos = initialPos;
}
if(map->version > EMapFormat::ROE)

View File

@@ -172,7 +172,7 @@ private:
* @param idToBeGiven the object id which should be set for the hero
* @return a object instance
*/
CGObjectInstance * readHero(ObjectInstanceID idToBeGiven);
CGObjectInstance * readHero(ObjectInstanceID idToBeGiven, const int3 & initialPos);
/**
* Reads a seer hut.