1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Modernize resourceSet

This commit is contained in:
Konstantin
2023-03-17 02:19:04 +03:00
parent ecbbbeda9b
commit bbbbfe00f0
12 changed files with 54 additions and 72 deletions

View File

@ -11,6 +11,7 @@
#include "CCreatureHandler.h"
#include "CGeneralTextHandler.h"
#include "ResourceSet.h"
#include "filesystem/Filesystem.h"
#include "VCMI_Lib.h"
#include "CGameState.h"
@ -267,7 +268,7 @@ bool CCreature::isEvil () const
return (*VLC->townh)[faction]->alignment == EAlignment::EVIL;
}
si32 CCreature::maxAmount(const std::vector<si32> &res) const //how many creatures can be bought
si32 CCreature::maxAmount(const TResources &res) const //how many creatures can be bought
{
int ret = 2147483645;
int resAmnt = static_cast<int>(std::min(res.size(),cost.size()));