Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Mar 5, 2024
1 parent 87b2894 commit 8f05f6d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Client/game_sa/CBuildingsPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inline bool CBuildingsPoolSA::AddBuildingToPool(CClientBuilding* pClientBuilding
return false;

uint32_t dwElementIndexInPool = (*m_ppBuildingPoolInterface)->GetObjectIndexSafe(pInterface);
if (dwElementIndexInPool >= -1)
if (dwElementIndexInPool == UINT_MAX)
return false;

m_buildingPool.arrayOfClientEntities[dwElementIndexInPool] = {pBuilding, (CClientEntity*)pClientBuilding};
Expand Down Expand Up @@ -90,7 +90,7 @@ void CBuildingsPoolSA::RemoveBuilding(CBuilding* pBuilding)
CBuildingSAInterface* pInterface = pBuilding->GetBuildingInterface();

uint32_t dwElementIndexInPool = (*m_ppBuildingPoolInterface)->GetObjectIndexSafe(pInterface);
if (dwElementIndexInPool == -1)
if (dwElementIndexInPool == UINT_MAX)
return;

// Remove building from world
Expand Down
16 changes: 8 additions & 8 deletions Client/game_sa/CIplStoreSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

static auto gIplQuadTree = (CQuadTreeNodesSAInterface<CIplSAInterface>**)0x8E3FAC;

CIplStoreSA::CIplStoreSA() : m_isStreamingEnbabled(true), m_ppIplPoolInterface((CPoolSAInterface<CIplSAInterface>**)0x8E3FB0)
CIplStoreSA::CIplStoreSA() : m_isStreamingEnabled(true), m_ppIplPoolInterface((CPoolSAInterface<CIplSAInterface>**)0x8E3FB0)
{
}

Expand All @@ -36,7 +36,7 @@ void CIplStoreSA::EnableStreaming(int iplId)

void CIplStoreSA::SetDynamicIplStreamingEnabled(bool state)
{
if (m_isStreamingEnbabled == state)
if (m_isStreamingEnabled == state)
return;

// Ipl with 0 index is generic
Expand Down Expand Up @@ -65,12 +65,12 @@ void CIplStoreSA::SetDynamicIplStreamingEnabled(bool state)
}
}

m_isStreamingEnbabled = state;
m_isStreamingEnabled = state;
}

void CIplStoreSA::SetDynamicIplStreamingEnabled(bool state, std::function<bool(CIplSAInterface* ipl)> filer)
void CIplStoreSA::SetDynamicIplStreamingEnabled(bool state, std::function<bool(CIplSAInterface* ipl)> filter)
{
if (m_isStreamingEnbabled == state)
if (m_isStreamingEnabled == state)
return;

// Ipl with 0 index is generic
Expand All @@ -81,7 +81,7 @@ void CIplStoreSA::SetDynamicIplStreamingEnabled(bool state, std::function<bool(C
{
for (int i = 1; i < pPool->m_nSize; i++)
{
if (pPool->IsContains(i) && filer(pPool->GetObject(i)))
if (pPool->IsContains(i) && filter(pPool->GetObject(i)))
{
UnloadAndDisableStreaming(i);
}
Expand All @@ -92,12 +92,12 @@ void CIplStoreSA::SetDynamicIplStreamingEnabled(bool state, std::function<bool(C
{
for (int i = 1; i < pPool->m_nSize; i++)
{
if (pPool->IsContains(i) && filer(pPool->GetObject(i)))
if (pPool->IsContains(i) && filter(pPool->GetObject(i)))
{
EnableStreaming(i);
}
}
}

m_isStreamingEnbabled = state;
m_isStreamingEnabled = state;
}
6 changes: 3 additions & 3 deletions Client/game_sa/CIplStoreSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "CIplSA.h"
#include "CPoolsSA.h"
#include <game/CIplStore.h>=
#include <game/CIplStore.h>
#include <functional>

class CIplStoreSA : public CIplStore
Expand All @@ -23,7 +23,7 @@ class CIplStoreSA : public CIplStore
~CIplStoreSA() = default;

void SetDynamicIplStreamingEnabled(bool state);
void SetDynamicIplStreamingEnabled(bool state, std::function<bool(CIplSAInterface *ipl)> filer);
void SetDynamicIplStreamingEnabled(bool state, std::function<bool(CIplSAInterface *ipl)> filter);

private:
void UnloadAndDisableStreaming(int iplId);
Expand All @@ -32,5 +32,5 @@ class CIplStoreSA : public CIplStore
private:
CPoolSAInterface<CIplSAInterface>** m_ppIplPoolInterface;

bool m_isStreamingEnbabled;
bool m_isStreamingEnabled;
};
2 changes: 1 addition & 1 deletion Client/game_sa/CPoolSAInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CPoolSAInterface
uint32_t GetObjectIndexSafe(B* pObject)
{
uint32_t index = GetObjectIndex(pObject);
return index > m_nSize ? -1 : index;
return index > m_nSize ? UINT_MAX : index;
}
};

Expand Down
2 changes: 1 addition & 1 deletion Client/sdk/game/CIplStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class CIplStore
{
public:
virtual void SetDynamicIplStreamingEnabled(bool state) = 0;
virtual void SetDynamicIplStreamingEnabled(bool state, std::function<bool(CIplSAInterface* ipl)> filer) = 0;
virtual void SetDynamicIplStreamingEnabled(bool state, std::function<bool(CIplSAInterface* ipl)> filter) = 0;
};

0 comments on commit 8f05f6d

Please sign in to comment.