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

fix prices

This commit is contained in:
Laserlicht
2025-09-14 15:04:02 +02:00
parent 62ca532291
commit ded1a70dd7
8 changed files with 53 additions and 23 deletions

View File

@@ -13,7 +13,7 @@
#include "ResourceSet.h"
#include "constants/StringConstants.h"
#include "serializer/JsonSerializeFormat.h"
#include "mapObjects/CObjectHandler.h"
#include "entities/ResourceTypeHandler.h"
#include "GameLibrary.h"
VCMI_LIB_NAMESPACE_BEGIN
@@ -98,7 +98,7 @@ TResourceCap ResourceSet::marketValue() const
{
TResourceCap total = 0;
for(int i = 0; i < GameConstants::RESOURCE_QUANTITY; i++)
total += static_cast<TResourceCap>(LIBRARY->objh->resVals[i]) * static_cast<TResourceCap>(operator[](i));
total += static_cast<TResourceCap>(LIBRARY->resourceTypeHandler->getById(i)->getPrice()) * static_cast<TResourceCap>(operator[](i));
return total;
}