From 4f5aae156931667b4f65aca1ae7cdffcf2b31a87 Mon Sep 17 00:00:00 2001 From: Uladzislau Nikalayevich Date: Thu, 3 Oct 2024 21:51:52 +0300 Subject: [PATCH] Fix IsUsesEntityDeleteRwObject --- Client/game_sa/CEntitySA.h | 2 +- Client/game_sa/CModelInfoSA.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/game_sa/CEntitySA.h b/Client/game_sa/CEntitySA.h index f37e75d0c4..067a47e9fc 100644 --- a/Client/game_sa/CEntitySA.h +++ b/Client/game_sa/CEntitySA.h @@ -217,7 +217,7 @@ class CEntitySAInterface : public CPlaceableSAInterface ((CStencilShadow_dtorByOwner)0x711730)(this); }; - bool IsUsesEntityDeleteRwObject() { return *(*reinterpret_cast(this) + 0x20) == 0x00534030; }; + bool IsUsesEntityDeleteRwObject() const { return *reinterpret_cast(*reinterpret_cast(this) + 0x20) == (void*)0x00534030; }; }; static_assert(sizeof(CEntitySAInterface) == 0x38, "Invalid size for CEntitySAInterface"); diff --git a/Client/game_sa/CModelInfoSA.cpp b/Client/game_sa/CModelInfoSA.cpp index 0552f03f95..e915b72f20 100644 --- a/Client/game_sa/CModelInfoSA.cpp +++ b/Client/game_sa/CModelInfoSA.cpp @@ -992,7 +992,7 @@ void CModelInfoSA::StaticFlushPendingRestreamIPL() i / 2 % NUM_StreamSectorRows, i / 2 / NUM_StreamSectorCols)); // Assert in debug #if MTA_DEBUG - assert(!pEntity->IsUsesEntityDeleteRwObject()); + assert(pEntity->IsUsesEntityDeleteRwObject()); #endif pSectorEntry = (DWORD*)pSectorEntry[1]; continue;