mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Fixed mapping of hota objects
This commit is contained in:
parent
952708e865
commit
312b703a78
@ -57,6 +57,7 @@ void CRewardableConstructor::configureObject(CGObjectInstance * object, CRandomG
|
||||
rewardInfo.reward.extraComponents.emplace_back(Component::EComponentType::LUCK, 0, bonus.val, 0);
|
||||
}
|
||||
}
|
||||
assert(!rewardableObject->configuration.info.empty());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,7 +338,8 @@ CGObjectInstance * MarketInstanceConstructor::create(std::shared_ptr<const Objec
|
||||
if(!title.empty())
|
||||
market->title = VLC->generaltexth->translate(title);
|
||||
|
||||
market->speech = VLC->generaltexth->translate(speech);
|
||||
if (!speech.empty())
|
||||
market->speech = VLC->generaltexth->translate(speech);
|
||||
|
||||
return market;
|
||||
}
|
||||
|
@ -922,8 +922,7 @@ void CMapLoaderH3M::readObjectTemplates()
|
||||
// Read custom defs
|
||||
for(int defID = 0; defID < defAmount; ++defID)
|
||||
{
|
||||
auto tmpl = std::make_shared<ObjectTemplate>();
|
||||
tmpl->readMap(reader->getInternalReader());
|
||||
auto tmpl = reader->readObjectTemplate();
|
||||
templates.push_back(tmpl);
|
||||
|
||||
if (!CResourceHandler::get()->existsResource(ResourceID( "SPRITES/" + tmpl->animationFile, EResType::ANIMATION)))
|
||||
|
@ -54,8 +54,8 @@ void MapIdentifiersH3M::loadMapping(const JsonNode & mapping)
|
||||
|
||||
for (auto entryTemplate : mapping["templates"].Struct())
|
||||
{
|
||||
std::string h3mName = entryTemplate.second.String();
|
||||
std::string vcmiName = entryTemplate.first;
|
||||
std::string h3mName = boost::to_lower_copy(entryTemplate.second.String());
|
||||
std::string vcmiName = boost::to_lower_copy(entryTemplate.first);
|
||||
|
||||
if (!CResourceHandler::get()->existsResource(ResourceID( "SPRITES/" + vcmiName, EResType::ANIMATION)))
|
||||
logMod->warn("Template animation file %s was not found!", vcmiName);
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include "../filesystem/CBinaryReader.h"
|
||||
#include "../int3.h"
|
||||
#include "../mapObjects/ObjectTemplate.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
@ -315,6 +316,14 @@ int3 MapReaderH3M::readInt3()
|
||||
return p;
|
||||
}
|
||||
|
||||
std::shared_ptr<ObjectTemplate> MapReaderH3M::readObjectTemplate()
|
||||
{
|
||||
auto tmpl = std::make_shared<ObjectTemplate>();
|
||||
tmpl->readMap(*reader);
|
||||
remapper.remapTemplate(*tmpl);
|
||||
return tmpl;
|
||||
}
|
||||
|
||||
void MapReaderH3M::skipUnused(size_t amount)
|
||||
{
|
||||
reader->skip(amount);
|
||||
|
@ -59,6 +59,8 @@ public:
|
||||
|
||||
int3 readInt3();
|
||||
|
||||
std::shared_ptr<ObjectTemplate> readObjectTemplate();
|
||||
|
||||
void skipUnused(size_t amount);
|
||||
void skipZero(size_t amount);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user