From 6ea7682c3c38c3cb9ccebac79e8cbc56df5d4ec1 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 18 Feb 2024 22:44:02 +0800 Subject: [PATCH] [saco] Implement `CEntity::sub_1009ED40(...)` --- saco/game/entity.cpp | 24 ++++++++++++++++++++++++ saco/game/entity.h | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/saco/game/entity.cpp b/saco/game/entity.cpp index d7f46ee..1dd6538 100644 --- a/saco/game/entity.cpp +++ b/saco/game/entity.cpp @@ -95,3 +95,27 @@ void CEntity::SetMoveSpeedVector(VECTOR Vector) //----------------------------------------------------------- +void CEntity::sub_1009ED40(float fX, float fY, float fZ) +{ + int x=4; + while(x) { + field_4[x-1].X = field_4[x].X; + field_4[x-1].Y = field_4[x].Y; + field_4[x-1].Z = field_4[x].Z; + x--; + } + + field_4[4].X = fX; + field_4[4].Y = fY; + field_4[4].Z = fZ; + + m_pEntity->vecMoveSpeed.X = + (field_4[0].X + field_4[1].X + field_4[2].X + field_4[3].X + field_4[4].X) * 0.2f; + m_pEntity->vecMoveSpeed.Y = + (field_4[0].Y + field_4[1].Y + field_4[2].Y + field_4[3].Y + field_4[4].Y) * 0.2f; + m_pEntity->vecMoveSpeed.Z = + (field_4[0].Z + field_4[1].Z + field_4[2].Z + field_4[3].Z + field_4[4].Z) * 0.2f; +} + +//----------------------------------------------------------- + diff --git a/saco/game/entity.h b/saco/game/entity.h index a40f80d..36aa24b 100644 --- a/saco/game/entity.h +++ b/saco/game/entity.h @@ -16,8 +16,9 @@ public: void sub_1009EC80(); void GetMoveSpeedVector(PVECTOR Vector); void SetMoveSpeedVector(VECTOR Vector); + void sub_1009ED40(float fX, float fY, float fZ); // unused - char field_4[60]; + VECTOR field_4[5]; ENTITY_TYPE *m_pEntity; DWORD m_dwGTAId; };