From dc0f63e824bab4584f445872c41b6c45b295acb2 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 3 Nov 2024 23:27:15 +0800 Subject: [PATCH] [saco] Implement/match `CEntity::MakeNonCollidable()` --- saco/game/common.h | 11 ++++++++--- saco/game/entity.cpp | 9 +++++++++ saco/game/entity.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/saco/game/common.h b/saco/game/common.h index 1b845f2..735a07e 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -106,14 +106,18 @@ typedef struct _ENTITY_TYPE MATRIX4X4 *mat; // 20-24 DWORD *pdwRenderWare; // 24-28 DWORD dwProcessingFlags; // 28-32 + char _gap20[2]; WORD nModelIndex; // 34-36 + char _gap24[18]; + BYTE nControlFlags; // 54-55 - char _gap37[11]; - BYTE byteImmunities; // 66-67 - BYTE byteUnkEntFlags; // 67-68 + + char _gap37[9]; + + DWORD dwPhysFlags; // 64-68 VECTOR vecMoveSpeed; // 68-80 VECTOR vecTurnSpeed; // 80-92 @@ -136,6 +140,7 @@ typedef struct _PED_TYPE PED_TASKS_TYPE *Tasks; // 1148-1152 DWORD dwPlayerInfoOffset; // 1152-1156 + char _gap484[124]; DWORD dwActiveVision; // 1280-1284 diff --git a/saco/game/entity.cpp b/saco/game/entity.cpp index baf75f8..1855b3d 100644 --- a/saco/game/entity.cpp +++ b/saco/game/entity.cpp @@ -586,6 +586,15 @@ void CEntity::SetApplySpeed(int iState) //----------------------------------------------------------- +void CEntity::MakeNonCollidable() +{ + if(m_pEntity) { + m_pEntity->dwPhysFlags &= 0xFFFFFFF7; + } +} + +//----------------------------------------------------------- + diff --git a/saco/game/entity.h b/saco/game/entity.h index 73a49cd..e92999f 100644 --- a/saco/game/entity.h +++ b/saco/game/entity.h @@ -42,6 +42,7 @@ public: void DisableStreaming(); void EnableTunnelTransition(); void SetApplySpeed(int iState); + void MakeNonCollidable(); virtual void Add(); virtual void Remove();