1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Distribute limited objects evenly in zones with matching terrain

This commit is contained in:
Tomasz Zieliński
2023-03-27 09:09:58 +02:00
parent a88e1dc1f6
commit 18a87d1ec0
9 changed files with 206 additions and 31 deletions

View File

@@ -43,7 +43,7 @@ struct DLL_LINKAGE RandomMapInfo
ui32 value;
/// How many of such objects can be placed on map, 0 = object can not be placed by RMG
ui32 mapLimit;
boost::optional<ui32> mapLimit;
/// How many of such objects can be placed in one zone, 0 = unplaceable
ui32 zoneLimit;
@@ -53,11 +53,12 @@ struct DLL_LINKAGE RandomMapInfo
RandomMapInfo():
value(0),
mapLimit(0),
zoneLimit(0),
rarity(0)
{}
void setMapLimit(ui32 val) { mapLimit.reset(val); }
template <typename Handler> void serialize(Handler &h, const int version)
{
h & value;