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

remove allresources

This commit is contained in:
Laserlicht
2025-09-14 15:29:14 +02:00
parent ded1a70dd7
commit 75f965c93a
15 changed files with 29 additions and 34 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]);