diff --git a/src/monster.cpp b/src/monster.cpp index 21f3d7d..4f007cc 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1072,8 +1072,8 @@ void Monster::onThinkYell(uint32_t) int32_t randomResult = rand(); if (rand() == 50 * (randomResult / 50)) { - int32_t totalVoices = mType->info.voiceVector.size(); - const voiceBlock_t& voice = mType->info.voiceVector[rand() % totalVoices + 1]; + uint32_t index = uniform_random(0, mType->info.voiceVector.size() - 1); + const voiceBlock_t& voice = mType->info.voiceVector[index]; if (voice.yellText) { g_game.internalCreatureSay(this, TALKTYPE_MONSTER_YELL, voice.text, false);