Skip to content

Commit 1b40db7

Browse files
authored
Fix buildings removal (#3319)
1 parent e83f700 commit 1b40db7

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

Client/game_sa/CWorldSA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ bool CWorldSA::IsRemovedModelInRadius(SIPLInst* pInst)
10691069

10701070
float fDistance = sqrt(fDistanceX * fDistanceX + fDistanceY * fDistanceY + fDistanceZ * fDistanceZ);
10711071
// is it in the removal spheres radius if so return else keep looking
1072-
if (fDistance <= pFind->m_fRadius && (pFind->m_cInterior == -1 || pFind->m_cInterior == pInst->m_nInterior))
1072+
if (fDistance <= pFind->m_fRadius && (pFind->m_cInterior == -1 || pFind->m_cInterior == pInst->m_nAreaCode))
10731073
{
10741074
return true;
10751075
}

Client/sdk/game/CWorld.h

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,27 @@ struct SBuildingRemoval
9595
std::list<CEntitySAInterface*>* m_pBinaryRemoveList;
9696
std::list<CEntitySAInterface*>* m_pDataRemoveList;
9797
};
98+
9899
struct SIPLInst
99100
{
100-
CVector m_pPosition;
101-
CVector m_pRotation;
102-
float m_fRotationCont;
103-
WORD m_nModelIndex;
104-
BYTE m_nInterior;
105-
BYTE m_bLOD;
101+
CVector m_pPosition;
102+
CVector4D m_pRotation;
103+
int32_t m_nModelIndex;
104+
union {
105+
struct {
106+
uint32_t m_nAreaCode : 8;
107+
uint32_t m_bRedundantStream : 1;
108+
uint32_t m_bDontStream : 1;
109+
uint32_t m_bUnderwater : 1;
110+
uint32_t m_bTunnel : 1;
111+
uint32_t m_bTunnelTransition : 1;
112+
uint32_t m_nReserved : 19;
113+
};
114+
uint32_t m_nInstanceType;
115+
};
116+
int32_t m_nLodInstanceIndex;
106117
};
118+
static_assert(sizeof(SIPLInst) == 0x28, "Invalid sizeof(SIPLInst)");
107119

108120
struct sDataBuildingRemovalItem
109121
{

0 commit comments

Comments
 (0)