|
@@ -119,7 +119,7 @@ void CMapLoaderH3M::readHeader()
|
|
|
// Map version
|
|
|
mapHeader->version = static_cast<EMapFormat>(reader->readUInt32());
|
|
|
|
|
|
- if(mapHeader->version == EMapFormat::HOTA1 || mapHeader->version == EMapFormat::HOTA2 || mapHeader->version == EMapFormat::HOTA3)
|
|
|
+ if(mapHeader->version == EMapFormat::HOTA)
|
|
|
{
|
|
|
uint32_t hotaVersion = reader->readUInt32();
|
|
|
features = MapFormatFeaturesH3M::find(mapHeader->version, hotaVersion);
|
|
@@ -1623,13 +1623,13 @@ CGObjectInstance * CMapLoaderH3M::readHero(const int3 & mapPosition, const Objec
|
|
|
|
|
|
bool hasGarison = reader->readBool();
|
|
|
if(hasGarison)
|
|
|
- readCreatureSet(object, 7);
|
|
|
-
|
|
|
- object->formation = static_cast<EArmyFormation>(reader->readUInt8());
|
|
|
- assert(object->formation == EArmyFormation::LOOSE || object->formation == EArmyFormation::TIGHT);
|
|
|
-
|
|
|
- loadArtifactsOfHero(object);
|
|
|
- object->patrol.patrolRadius = reader->readUInt8();
|
|
|
+ readCreatureSet(object, 7);
|
|
|
+
|
|
|
+ object->formation = static_cast<EArmyFormation>(reader->readUInt8());
|
|
|
+ assert(object->formation == EArmyFormation::LOOSE || object->formation == EArmyFormation::TIGHT);
|
|
|
+
|
|
|
+ loadArtifactsOfHero(object);
|
|
|
+ object->patrol.patrolRadius = reader->readUInt8();
|
|
|
object->patrol.patrolling = (object->patrol.patrolRadius != 0xff);
|
|
|
|
|
|
if(features.levelAB)
|
|
@@ -1952,13 +1952,13 @@ CGObjectInstance * CMapLoaderH3M::readTown(const int3 & position, std::shared_pt
|
|
|
|
|
|
bool hasGarrison = reader->readBool();
|
|
|
if(hasGarrison)
|
|
|
- readCreatureSet(object, 7);
|
|
|
-
|
|
|
- object->formation = static_cast<EArmyFormation>(reader->readUInt8());
|
|
|
- assert(object->formation == EArmyFormation::LOOSE || object->formation == EArmyFormation::TIGHT);
|
|
|
-
|
|
|
- bool hasCustomBuildings = reader->readBool();
|
|
|
- if(hasCustomBuildings)
|
|
|
+ readCreatureSet(object, 7);
|
|
|
+
|
|
|
+ object->formation = static_cast<EArmyFormation>(reader->readUInt8());
|
|
|
+ assert(object->formation == EArmyFormation::LOOSE || object->formation == EArmyFormation::TIGHT);
|
|
|
+
|
|
|
+ bool hasCustomBuildings = reader->readBool();
|
|
|
+ if(hasCustomBuildings)
|
|
|
{
|
|
|
reader->readBitmask(object->builtBuildings, features.buildingsBytes, features.buildingsCount, false);
|
|
|
reader->readBitmask(object->forbiddenBuildings, features.buildingsBytes, features.buildingsCount, false);
|