mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-12-22 00:57:11 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user