From 6452edd2f1fe8ea3c061e3026732ebd08daae099 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Fri, 4 Sep 2026 22:19:16 +0700 Subject: [PATCH] [saco] Match `CLocalPlayer::SelectNextClass`; the class step plays sound 1052/1053 through `CAudio` at `pGame+0` --- saco/net/localplayer.cpp | 43 ++++++++++++++++++++++++++++++++++++++++ saco/net/localplayer.h | 4 +++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/saco/net/localplayer.cpp b/saco/net/localplayer.cpp index 3373fda..ea3c1d3 100644 --- a/saco/net/localplayer.cpp +++ b/saco/net/localplayer.cpp @@ -185,3 +185,46 @@ void CLocalPlayer::SendStatsUpdate() bsSend.Write(iDrunkLevel); pNetGame->GetRakClient()->Send(&bsSend, HIGH_PRIORITY, UNRELIABLE, 0); } + +//---------------------------------------------------- + +// class selection cycles field_2FE and re-requests on every step +void CLocalPlayer::SelectNextClass() +{ + if(!field_306) + return; + + MATRIX4X4 mat; + + field_143 = 0; + m_pPlayerPed->GetMatrix(&mat); + + if(field_2FE == pNetGame->GetSettings()->field_23 - 1) + field_2FE = 0; + else + field_2FE++; + + pGame->m_pGameAudio->PlaySound(1052, mat.pos.X, mat.pos.Y, mat.pos.Z); + RequestClass(field_2FE); +} + +//---------------------------------------------------- + +void CLocalPlayer::SelectPreviousClass() +{ + if(!field_306) + return; + + MATRIX4X4 mat; + + field_143 = 0; + m_pPlayerPed->GetMatrix(&mat); + + DWORD dwClass = field_2FE; + if(!dwClass) + dwClass = pNetGame->GetSettings()->field_23; + + field_2FE = dwClass - 1; + pGame->m_pGameAudio->PlaySound(1053, mat.pos.X, mat.pos.Y, mat.pos.Z); + RequestClass(field_2FE); +} diff --git a/saco/net/localplayer.h b/saco/net/localplayer.h index 481ca8a..819585a 100644 --- a/saco/net/localplayer.h +++ b/saco/net/localplayer.h @@ -54,7 +54,7 @@ public: DWORD field_13B; DWORD field_13F; - BYTE _pad143[4]; + DWORD field_143; DWORD field_147; @@ -118,6 +118,8 @@ public: BOOL IsInRCMode() { return m_bInRCMode; }; + void SelectNextClass(); // .text:10005FF0 + void SelectPreviousClass(); // .text:10006080 void RequestClass(int iClass); // .text:100058D0 void SendStatsUpdate(); // .text:10005D00 void FUNC_10005BF0(WORD a1); // .text:10005BF0