Skip to content

Commit

Permalink
Reset capacity after disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Jan 31, 2025
1 parent f9c39b0 commit abee415
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Client/game_sa/CPtrNodeSingleLinkPoolSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CPtrNodeSingleLinkPoolSA final : public CPtrNodeSingleLinkPool
std::size_t GetUsedSize() const override { return m_customPool->GetUsedSize(); }

bool Resize(std::size_t newSize) override { return m_customPool->SetCapacity(newSize); };
void ResetCapacity() override { m_customPool->SetCapacity(MAX_POINTER_SINGLE_LINKS); };

static auto* GetPoolInstance() { return m_customPool; }
static void StaticSetHooks();
Expand Down
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ CClientGame::~CClientGame()
g_pGame->SetPreWeaponFireHandler(NULL);
g_pGame->SetPostWeaponFireHandler(NULL);
g_pGame->SetTaskSimpleBeHitHandler(NULL);
g_pGame->GetPools()->GetPtrNodeSingleLinkPool().ResetCapacity();
g_pGame->GetAudioEngine()->SetWorldSoundHandler(NULL);
g_pCore->SetMessageProcessor(NULL);
g_pCore->GetKeyBinds()->SetKeyStrokeHandler(NULL);
Expand Down
3 changes: 2 additions & 1 deletion Client/sdk/game/CPtrNodeSingleLinkPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
class CPtrNodeSingleLinkPool
{
public:
virtual bool Resize(std::size_t size) = 0;
virtual bool Resize(std::size_t size) = 0;
virtual void ResetCapacity() = 0;
virtual std::size_t GetCapacity() const = 0;
virtual std::size_t GetUsedSize() const = 0;
};

0 comments on commit abee415

Please sign in to comment.