Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buildings removal #3319

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client/game_sa/CWorldSA.cpp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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