From efaee56ef57095d6f10bb220cf960c6b11262040 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 7 Nov 2026 03:39:40 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/HitSounds.cpp Batch #13971 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_23395 CSession::GetHitWaveName: logic confirmed by peer review - fn_23481 CSession::GetWeaponHitWaveName: logic confirmed by peer review Peer-reviewed-by: Yommy, KWDev, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/HitSounds.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Contents/HitSounds.cpp b/Source/Contents/HitSounds.cpp index 7e059ef12..2b8be679d 100644 --- a/Source/Contents/HitSounds.cpp +++ b/Source/Contents/HitSounds.cpp @@ -1,6 +1,7 @@ #include "Client/Session.h" #include "Contents/Jobs/JobInheritance.h" +#include #include #include #include @@ -18,7 +19,7 @@ const char* CSession::GetHitWaveName(int job) { const int weapon = GetRealWeaponId(-1); if (weapon == -1) { - switch (std::rand() % 4) { + switch (std::max(std::rand() % 4, 0)) { case 0: return "_enemy_hit_normal1.wav"; case 1: @@ -40,7 +41,7 @@ const char* CSession::GetHitWaveName(int job) { } if (weapon == 0) { - switch (std::rand() % 4) { + switch (std::max(std::rand() % 4, 0)) { case 0: return "_hit_fist1.wav"; case 1: @@ -60,7 +61,7 @@ const char* CSession::GetHitWaveName(int job) { const char* CSession::GetWeaponHitWaveName(int weapon) { const int realWeapon = GetRealWeaponId(weapon); if (realWeapon == -1) { - switch (std::rand() % 4) { + switch (std::max(std::rand() % 4, 0)) { case 0: return "_enemy_hit_normal1.wav"; case 1: @@ -82,7 +83,7 @@ const char* CSession::GetWeaponHitWaveName(int weapon) { } if (realWeapon == 0) { - switch (std::rand() % 4) { + switch (std::max(std::rand() % 4, 0)) { case 0: return "_hit_fist1.wav"; case 1: