1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-13 13:18:43 +02:00

Also check for json when checking for battle animation existance

This commit is contained in:
Ivan Savenko 2024-06-07 11:57:46 +00:00
parent 381171f897
commit 22e58387f9

View File

@ -648,7 +648,9 @@ CCreature * CCreatureHandler::loadFromJson(const std::string & scope, const Json
if (!cre->special &&
!CResourceHandler::get()->existsResource(cre->animDefName) &&
!CResourceHandler::get()->existsResource(cre->animDefName.addPrefix("SPRITES/")))
!CResourceHandler::get()->existsResource(cre->animDefName.toType<EResType::JSON>()) &&
!CResourceHandler::get()->existsResource(cre->animDefName.addPrefix("SPRITES/")) &&
!CResourceHandler::get()->existsResource(cre->animDefName.addPrefix("SPRITES/").toType<EResType::JSON>()))
throw ModLoadingException(scope, "creature " + cre->getJsonKey() + " has no combat animation but is not marked as special!" );
JsonNode advMapFile = node["graphics"]["map"];