mirror of
				https://github.com/ErikasKontenis/SabrehavenServer.git
				synced 2025-10-31 03:56:22 +01:00 
			
		
		
		
	extra important / fix crash bug when onThinkYell
This commit is contained in:
		| @@ -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); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ErikasKontenis
					ErikasKontenis