mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Fixes patrol position initialization on H3M load
This commit is contained in:
parent
48c01157e6
commit
2f5ee44cbe
@ -319,6 +319,9 @@ void CGHeroInstance::initHero(CRandomGenerator & rand)
|
||||
}
|
||||
assert(validTypes());
|
||||
|
||||
if (patrol.patrolling)
|
||||
patrol.initialPos = visitablePos();
|
||||
|
||||
if(exp == 0xffffffff)
|
||||
{
|
||||
initExp(rand);
|
||||
|
@ -1657,15 +1657,7 @@ CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven, const i
|
||||
nhi->formation = reader.readUInt8();
|
||||
loadArtifactsOfHero(nhi);
|
||||
nhi->patrol.patrolRadius = reader.readUInt8();
|
||||
if(nhi->patrol.patrolRadius == 0xff)
|
||||
{
|
||||
nhi->patrol.patrolling = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
nhi->patrol.patrolling = true;
|
||||
nhi->patrol.initialPos = nhi->convertToVisitablePos(initialPos);
|
||||
}
|
||||
nhi->patrol.patrolling = (nhi->patrol.patrolRadius != 0xff);
|
||||
|
||||
if(map->version > EMapFormat::ROE)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user