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