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

refactoring with guardingCreaturePosition

This commit is contained in:
Mircea TheHonestCTO
2025-08-15 00:19:51 +02:00
parent 423eb70e2e
commit 39bd4a2d20
3 changed files with 13 additions and 30 deletions

View File

@@ -3996,7 +3996,7 @@ void CGameHandler::spawnWanderingMonsters(CreatureID creatureID)
std::vector<int3>::iterator tile;
std::vector<int3> tiles;
gameState().getFreeTiles(tiles, true);
ui32 amount = tiles.size() / 10; //Chance is 10% for each free tile. Higher than 0.5% because there are way fewer with nearby unblocked
ui32 amount = tiles.size() / 100; //Chance is 1% for each tile. Higher than the original 0.5% because there are fewer with nearby unguarded
RandomGeneratorUtil::randomShuffle(tiles, getRandomGenerator());
logGlobal->trace("Spawning wandering monsters. Found %d free tiles. Creature type: %d", tiles.size(), creatureID.num);