mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-29 17:19:20 +02:00
extra important / fix crash bug when onThinkYell
This commit is contained in:
parent
ab6a677b7a
commit
bbd5aa0ac0
@ -1072,8 +1072,8 @@ void Monster::onThinkYell(uint32_t)
|
|||||||
|
|
||||||
int32_t randomResult = rand();
|
int32_t randomResult = rand();
|
||||||
if (rand() == 50 * (randomResult / 50)) {
|
if (rand() == 50 * (randomResult / 50)) {
|
||||||
int32_t totalVoices = mType->info.voiceVector.size();
|
uint32_t index = uniform_random(0, mType->info.voiceVector.size() - 1);
|
||||||
const voiceBlock_t& voice = mType->info.voiceVector[rand() % totalVoices + 1];
|
const voiceBlock_t& voice = mType->info.voiceVector[index];
|
||||||
|
|
||||||
if (voice.yellText) {
|
if (voice.yellText) {
|
||||||
g_game.internalCreatureSay(this, TALKTYPE_MONSTER_YELL, voice.text, false);
|
g_game.internalCreatureSay(this, TALKTYPE_MONSTER_YELL, voice.text, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user