mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Fixed parsing of hota 'arena' map format hacks
This commit is contained in:
@@ -129,11 +129,10 @@ void CMapLoaderH3M::readHeader()
|
|||||||
{
|
{
|
||||||
reader->skipZero(1);
|
reader->skipZero(1);
|
||||||
//TODO: HotA
|
//TODO: HotA
|
||||||
bool isDuelMap = reader->readBool();
|
bool isArenaMap = reader->readBool();
|
||||||
if (isDuelMap)
|
if (isArenaMap)
|
||||||
{
|
{
|
||||||
logGlobal->warn("Map '%s': Duel maps are not supported!", mapName);
|
logGlobal->warn("Map '%s': Arena maps are not supported!", mapName);
|
||||||
throw std::runtime_error("Invalid map format!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1240,10 +1239,18 @@ CGObjectInstance * CMapLoaderH3M::readHeroPlaceholder(const int3 & mapPosition)
|
|||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGObjectInstance * CMapLoaderH3M::readGrail(const int3 & mapPosition)
|
CGObjectInstance * CMapLoaderH3M::readGrail(const int3 & mapPosition, std::shared_ptr<const ObjectTemplate> objectTemplate)
|
||||||
{
|
{
|
||||||
map->grailPos = mapPosition;
|
if (objectTemplate->subid < 1000)
|
||||||
map->grailRadius = reader->readInt32();
|
{
|
||||||
|
map->grailPos = mapPosition;
|
||||||
|
map->grailRadius = reader->readInt32();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Battle location for arena mode in HotA
|
||||||
|
logGlobal->warn("Map '%s': Arena mode is not supported!", mapName);
|
||||||
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1416,7 +1423,7 @@ CGObjectInstance * CMapLoaderH3M::readObject(std::shared_ptr<const ObjectTemplat
|
|||||||
return readPandora(mapPosition);
|
return readPandora(mapPosition);
|
||||||
|
|
||||||
case Obj::GRAIL:
|
case Obj::GRAIL:
|
||||||
return readGrail(mapPosition);
|
return readGrail(mapPosition, objectTemplate);
|
||||||
|
|
||||||
case Obj::RANDOM_DWELLING:
|
case Obj::RANDOM_DWELLING:
|
||||||
case Obj::RANDOM_DWELLING_LVL:
|
case Obj::RANDOM_DWELLING_LVL:
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ private:
|
|||||||
CGObjectInstance * readDwellingRandom(const int3 & position, std::shared_ptr<const ObjectTemplate> objTempl);
|
CGObjectInstance * readDwellingRandom(const int3 & position, std::shared_ptr<const ObjectTemplate> objTempl);
|
||||||
CGObjectInstance * readShrine();
|
CGObjectInstance * readShrine();
|
||||||
CGObjectInstance * readHeroPlaceholder(const int3 & position);
|
CGObjectInstance * readHeroPlaceholder(const int3 & position);
|
||||||
CGObjectInstance * readGrail(const int3 & position);
|
CGObjectInstance * readGrail(const int3 & position, std::shared_ptr<const ObjectTemplate> objectTemplate);
|
||||||
CGObjectInstance * readPyramid(const int3 & position, std::shared_ptr<const ObjectTemplate> objTempl);
|
CGObjectInstance * readPyramid(const int3 & position, std::shared_ptr<const ObjectTemplate> objTempl);
|
||||||
CGObjectInstance * readBorderGuard();
|
CGObjectInstance * readBorderGuard();
|
||||||
CGObjectInstance * readBorderGate(const int3 & position, std::shared_ptr<const ObjectTemplate> objTempl);
|
CGObjectInstance * readBorderGate(const int3 & position, std::shared_ptr<const ObjectTemplate> objTempl);
|
||||||
|
|||||||
Reference in New Issue
Block a user