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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user