From ed0c20163adc05298231f3751c643201bbfe1d25 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sat, 5 Sep 2026 10:41:18 +0700 Subject: [PATCH] [saco] Match `GetSpecialAction`; the branchless tail needs a `BYTE` destination or the `sbb` comes out 32-bit --- saco/game/playerped.h | 4 +++ saco/net/localplayer.cpp | 64 ++++++++++++++++++++++++++++++++++++++++ saco/net/localplayer.h | 1 + 3 files changed, 69 insertions(+) diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 64bde9f..e247653 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -206,6 +206,10 @@ public: void FUNC_100AFFD0(); // .text:100AFFD0 int FUNC_100AE260(); // .text:100AE260 + int FUNC_100ACDC0(); // .text:100ACDC0 + int FUNC_100ACB60(); // .text:100ACB60 + int FUNC_100ADB60(); // .text:100ADB60 + int FUNC_100AE0A0(); // .text:100AE0A0 void FUNC_100AE100(); // .text:100AE100 void FUNC_100ADCA0(); // .text:100ADCA0 void FUNC_100B02D0(int a1); // .text:100B02D0 diff --git a/saco/net/localplayer.cpp b/saco/net/localplayer.cpp index b8dffea..1967182 100644 --- a/saco/net/localplayer.cpp +++ b/saco/net/localplayer.cpp @@ -783,3 +783,67 @@ void CLocalPlayer::FUNC_10002FA0() } } } + +//---------------------------------------------------- + +// the special action code the sync packets carry; 5 to 8 are the dance styles +BYTE CLocalPlayer::GetSpecialAction() +{ + if(m_pPlayerPed->FUNC_100ACDC0()) + return 2; + + if(m_pPlayerPed->FUNC_100ADB60()) + { + switch(m_pPlayerPed->m_iDanceStyle) + { + case 0: + return 5; + case 1: + return 6; + case 2: + return 7; + case 3: + return 8; + } + } + + if(m_pPlayerPed->FUNC_100ACB60()) + return 10; + + if(m_pPlayerPed->FUNC_100AE0A0()) + return 11; + + if(m_pPlayerPed->FUNC_100AE260()) + return 68; + + if(m_pPlayerPed->FUNC_100AC690()) + return 1; + + if(m_pPlayerPed->FUNC_100AC5D0()) + return 3; + + if(m_pPlayerPed->FUNC_100AC640()) + return 4; + + if(m_pPlayerPed->FUNC_100ADC90()) + { + if(m_pPlayerPed->FUNC_100ADC90() == 1) + return 20; + + if(m_pPlayerPed->FUNC_100ADC90() == 2) + return 22; + + if(m_pPlayerPed->FUNC_100ADC90() == 3) + return 23; + + if(m_pPlayerPed->FUNC_100ADC90() == 4) + return 21; + } + + if(m_pPlayerPed->FUNC_100ACEF0()) + return 24; + + BYTE byteAction = m_pPlayerPed->FUNC_100ACE40() ? 25 : 0; + + return byteAction; +} diff --git a/saco/net/localplayer.h b/saco/net/localplayer.h index a4ba7e9..3ac47ef 100644 --- a/saco/net/localplayer.h +++ b/saco/net/localplayer.h @@ -152,6 +152,7 @@ public: void FUNC_10004230(WORD a1); // .text:10004230 void FUNC_10004280(PLAYERID playerId); // .text:10004280 void FUNC_10002FA0(); // .text:10002FA0 + BYTE GetSpecialAction(); // .text:10003410 void FUNC_10006100(); // .text:10006100 void SendDeath(); // .text:10005810 void SetInteriorId(BYTE byteInteriorId); // .text:10005970