1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Basic version of object templates mapping

This commit is contained in:
Ivan Savenko
2023-05-24 22:02:27 +03:00
parent b3ca6c8cee
commit 952708e865
4 changed files with 86 additions and 15 deletions

View File

@@ -922,9 +922,12 @@ void CMapLoaderH3M::readObjectTemplates()
// Read custom defs
for(int defID = 0; defID < defAmount; ++defID)
{
auto * tmpl = new ObjectTemplate;
auto tmpl = std::make_shared<ObjectTemplate>();
tmpl->readMap(reader->getInternalReader());
templates.push_back(std::shared_ptr<const ObjectTemplate>(tmpl));
templates.push_back(tmpl);
if (!CResourceHandler::get()->existsResource(ResourceID( "SPRITES/" + tmpl->animationFile, EResType::ANIMATION)))
logMod->warn("Template animation %s of type (%d %d) is missing!", tmpl->animationFile, tmpl->id, tmpl->subid );
}
}