mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
multiple fixes
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <vcmi/Services.h>
|
||||
#include <vcmi/SkillService.h>
|
||||
#include <vcmi/spells/Service.h>
|
||||
#include <vcmi/ResourceTypeService.h>
|
||||
|
||||
RenderHandler::RenderHandler()
|
||||
:assetGenerator(std::make_unique<AssetGenerator>())
|
||||
@@ -494,6 +495,7 @@ void RenderHandler::onLibraryLoadingFinished(const Services * services)
|
||||
addImageListEntries(services->factions());
|
||||
addImageListEntries(services->spells());
|
||||
addImageListEntries(services->skills());
|
||||
addImageListEntries(services->resources());
|
||||
|
||||
if (settings["mods"]["validation"].String() == "full")
|
||||
{
|
||||
|
||||
@@ -99,7 +99,12 @@ public:
|
||||
|
||||
const TResource & operator[](size_t index) const
|
||||
{
|
||||
return container.at(GameResID(index));
|
||||
auto it = container.find(GameResID(index));
|
||||
if (it != container.end())
|
||||
return it->second;
|
||||
|
||||
static const TResource default_resource{};
|
||||
return default_resource;
|
||||
}
|
||||
|
||||
bool empty () const
|
||||
|
||||
@@ -65,7 +65,7 @@ std::shared_ptr<Resource> ResourceTypeHandler::loadFromJson(const std::string &
|
||||
|
||||
const std::vector<std::string> & ResourceTypeHandler::getTypeNames() const
|
||||
{
|
||||
static const std::vector<std::string> types = { "resources" };
|
||||
static const std::vector<std::string> types = { "resource" };
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <vcmi/HeroTypeService.h>
|
||||
#include <vcmi/SkillService.h>
|
||||
#include <vcmi/spells/Service.h>
|
||||
#include <vcmi/ResourceTypeService.h>
|
||||
|
||||
#include "../lib/filesystem/Filesystem.h"
|
||||
#include "../lib/filesystem/CBinaryReader.h"
|
||||
@@ -342,4 +343,5 @@ void Graphics::initializeImageLists()
|
||||
addImageListEntries(LIBRARY->factions());
|
||||
addImageListEntries(LIBRARY->spells());
|
||||
addImageListEntries(LIBRARY->skills());
|
||||
addImageListEntries(LIBRARY->resources());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user