Skip to content

Commit abee415

Browse files
committed
Reset capacity after disconnect
1 parent f9c39b0 commit abee415

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Client/game_sa/CPtrNodeSingleLinkPoolSA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class CPtrNodeSingleLinkPoolSA final : public CPtrNodeSingleLinkPool
2828
std::size_t GetUsedSize() const override { return m_customPool->GetUsedSize(); }
2929

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

3233
static auto* GetPoolInstance() { return m_customPool; }
3334
static void StaticSetHooks();

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ CClientGame::~CClientGame()
515515
g_pGame->SetPreWeaponFireHandler(NULL);
516516
g_pGame->SetPostWeaponFireHandler(NULL);
517517
g_pGame->SetTaskSimpleBeHitHandler(NULL);
518+
g_pGame->GetPools()->GetPtrNodeSingleLinkPool().ResetCapacity();
518519
g_pGame->GetAudioEngine()->SetWorldSoundHandler(NULL);
519520
g_pCore->SetMessageProcessor(NULL);
520521
g_pCore->GetKeyBinds()->SetKeyStrokeHandler(NULL);

Client/sdk/game/CPtrNodeSingleLinkPool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
class CPtrNodeSingleLinkPool
1414
{
1515
public:
16-
virtual bool Resize(std::size_t size) = 0;
16+
virtual bool Resize(std::size_t size) = 0;
17+
virtual void ResetCapacity() = 0;
1718
virtual std::size_t GetCapacity() const = 0;
1819
virtual std::size_t GetUsedSize() const = 0;
1920
};

0 commit comments

Comments
 (0)