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