Bug Fixes

Fixed an issue that caused players to increase distance fighting by wielding a distance weapon on hands and on ammunition slots.

Fixed an issue with monster yelling (C code not compatible with C++ entirely, thank you IDA).
This commit is contained in:
Alejandro Mujica
2019-02-05 12:42:16 -04:00
parent 2412e3a825
commit 1aaa6288a8
3 changed files with 17 additions and 15 deletions

View File

@@ -1028,13 +1028,15 @@ 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];
if (!mType->info.voiceVector.empty()) {
uint32_t index = uniform_random(0, mType->info.voiceVector.size() - 1);
const voiceBlock_t& vb = mType->info.voiceVector[index];
if (voice.yellText) {
g_game.internalCreatureSay(this, TALKTYPE_MONSTER_YELL, voice.text, false);
} else {
g_game.internalCreatureSay(this, TALKTYPE_MONSTER_SAY, voice.text, false);
if (vb.yellText) {
g_game.internalCreatureSay(this, TALKTYPE_MONSTER_YELL, vb.text, false);
} else {
g_game.internalCreatureSay(this, TALKTYPE_MONSTER_SAY, vb.text, false);
}
}
}
}