From 98ef9925ceaa737bebb6867167deb88135d2e305 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:08:55 +0800 Subject: [PATCH] [saco] Implement/match `CEntity::SetApplySpeed(...)` --- saco/game/entity.cpp | 29 +++++++++++++++++++++++++++++ saco/game/entity.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/saco/game/entity.cpp b/saco/game/entity.cpp index c44332a..baf75f8 100644 --- a/saco/game/entity.cpp +++ b/saco/game/entity.cpp @@ -562,6 +562,35 @@ void CEntity::EnableTunnelTransition() m_pEntity->dwProcessingFlags |= 0x80000000; } +//----------------------------------------------------------- + +void CEntity::SetApplySpeed(int iState) +{ + if(!m_pEntity) return; + if(m_pEntity->vtable == 0x863C40) return; + + DWORD dwEnt = (DWORD)m_pEntity; + + if(!iState) { + _asm mov edx, dwEnt + _asm mov eax, [edx+0x40] + _asm or ah, 0x20 + _asm mov [edx+0x40], eax + } else { + _asm mov edx, dwEnt + _asm mov eax, [edx+0x40] + _asm and ah, 0xDF + _asm mov [edx+0x40], eax + } +} + +//----------------------------------------------------------- + + + + + + //----------------------------------------------------------- BOOL CEntity::IsStationary() diff --git a/saco/game/entity.h b/saco/game/entity.h index 7dda953..73a49cd 100644 --- a/saco/game/entity.h +++ b/saco/game/entity.h @@ -41,6 +41,8 @@ public: void SetWaitingForCollision(int iState); void DisableStreaming(); void EnableTunnelTransition(); + void SetApplySpeed(int iState); + virtual void Add(); virtual void Remove(); BOOL IsAdded();