1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Replaced most of usages of CRandomGenerator with vstd::RNG in library

This commit is contained in:
Ivan Savenko
2024-06-01 15:28:17 +00:00
parent 60a51e98de
commit 63bcf7d83c
125 changed files with 620 additions and 409 deletions

View File

@ -24,6 +24,7 @@
#include "ConditionalWait.h"
#include "../lib/CConfigHandler.h"
#include "../lib/CRandomGenerator.h"
#include "../lib/pathfinder/CGPathNode.h"
#include "../lib/mapObjects/CGHeroInstance.h"
#include "../lib/networkPacks/PacksForClient.h"
@ -153,8 +154,12 @@ void HeroMovementController::onTryMoveHero(const CGHeroInstance * hero, const Tr
if(details.result == TryMoveHero::EMBARK || details.result == TryMoveHero::DISEMBARK)
{
if(hero->getRemovalSound() && hero->tempOwner == LOCPLINT->playerID)
CCS->soundh->playSound(hero->getRemovalSound().value());
if (hero->tempOwner == LOCPLINT->playerID)
{
auto removalSound = hero->getRemovalSound(CRandomGenerator::getDefault());
if (removalSound)
CCS->soundh->playSound(removalSound.value());
}
}
bool directlyAttackingCreature =