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