1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Select random object template instead of first

This commit is contained in:
nordsoft
2023-09-30 01:19:18 +02:00
parent 811680c4c5
commit ce62ab3e66
7 changed files with 28 additions and 26 deletions

View File

@@ -254,7 +254,7 @@ bool WaterProxy::placeBoat(Zone & land, const Lake & lake, bool createRoad, Rout
auto * boat = dynamic_cast<CGBoat *>(VLC->objtypeh->getHandlerFor(Obj::BOAT, *RandomGeneratorUtil::nextItem(sailingBoatTypes, zone.getRand()))->create());
rmg::Object rmgObject(*boat);
rmgObject.setTemplate(zone.getTerrainType());
rmgObject.setTemplate(zone.getTerrainType(), zone.getRand());
auto waterAvailable = zone.areaPossible() + zone.freePaths();
rmg::Area coast = lake.neighbourZones.at(land.getId()); //having land tiles
@@ -319,7 +319,7 @@ bool WaterProxy::placeShipyard(Zone & land, const Lake & lake, si32 guard, bool
shipyard->tempOwner = PlayerColor::NEUTRAL;
rmg::Object rmgObject(*shipyard);
rmgObject.setTemplate(land.getTerrainType());
rmgObject.setTemplate(land.getTerrainType(), zone.getRand());
bool guarded = manager->addGuard(rmgObject, guard);
auto waterAvailable = zone.areaPossible() + zone.freePaths();