1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Merge pull request #6136 from Laserlicht/resource

Configurable resources
This commit is contained in:
Ivan Savenko
2025-09-28 21:51:10 +03:00
committed by GitHub
96 changed files with 674 additions and 314 deletions

View File

@@ -25,6 +25,7 @@
#include "../networkPacks/StackLocation.h"
#include "../serializer/JsonSerializeFormat.h"
#include "../entities/faction/CTownHandler.h"
#include "../entities/ResourceTypeHandler.h"
#include <vstd/RNG.h>
@@ -630,7 +631,7 @@ void CGCreature::giveReward(IGameEventCallback & gameEvents, const CGHeroInstanc
if(!resources.empty())
{
gameEvents.giveResources(h->tempOwner, resources);
for(const auto & res : GameResID::ALL_RESOURCES())
for(const auto & res : LIBRARY->resourceTypeHandler->getAllObjects())
{
if(resources[res] > 0)
iw.components.emplace_back(ComponentType::RESOURCE, res, resources[res]);