Skip to content

Commit

Permalink
Fix buildings removal (#3319)
Browse files Browse the repository at this point in the history
  • Loading branch information
tederis committed Feb 22, 2024
1 parent e83f700 commit 1b40db7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Client/game_sa/CWorldSA.cpp
Expand Up @@ -1069,7 +1069,7 @@ bool CWorldSA::IsRemovedModelInRadius(SIPLInst* pInst)

float fDistance = sqrt(fDistanceX * fDistanceX + fDistanceY * fDistanceY + fDistanceZ * fDistanceZ);
// is it in the removal spheres radius if so return else keep looking
if (fDistance <= pFind->m_fRadius && (pFind->m_cInterior == -1 || pFind->m_cInterior == pInst->m_nInterior))
if (fDistance <= pFind->m_fRadius && (pFind->m_cInterior == -1 || pFind->m_cInterior == pInst->m_nAreaCode))
{
return true;
}
Expand Down
24 changes: 18 additions & 6 deletions Client/sdk/game/CWorld.h
Expand Up @@ -95,15 +95,27 @@ struct SBuildingRemoval
std::list<CEntitySAInterface*>* m_pBinaryRemoveList;
std::list<CEntitySAInterface*>* m_pDataRemoveList;
};

struct SIPLInst
{
CVector m_pPosition;
CVector m_pRotation;
float m_fRotationCont;
WORD m_nModelIndex;
BYTE m_nInterior;
BYTE m_bLOD;
CVector m_pPosition;
CVector4D m_pRotation;
int32_t m_nModelIndex;
union {
struct {
uint32_t m_nAreaCode : 8;
uint32_t m_bRedundantStream : 1;
uint32_t m_bDontStream : 1;
uint32_t m_bUnderwater : 1;
uint32_t m_bTunnel : 1;
uint32_t m_bTunnelTransition : 1;
uint32_t m_nReserved : 19;
};
uint32_t m_nInstanceType;
};
int32_t m_nLodInstanceIndex;
};
static_assert(sizeof(SIPLInst) == 0x28, "Invalid sizeof(SIPLInst)");

struct sDataBuildingRemovalItem
{
Expand Down

0 comments on commit 1b40db7

Please sign in to comment.