Skip to content

Commit b4ebe7e

Browse files
committed
feat: Implemented new Utils namespace in CBasePlayer and made function static
1 parent 7be1ee4 commit b4ebe7e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/modules/cbaseplayer.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@
66
*********************************************************************/
77

88
#include "stdafx.hpp"
9-
#include "cbaseplayer.h"
9+
#include "modules/cbaseplayer.h"
1010

1111
#include <KeyValues.h>
1212

1313
#include "utils/loggingsystem.hpp"
14+
#include "utils/memory.hpp"
15+
16+
#include "modules/utils.h"
1417

1518
void CBasePlayer::ShowViewPortPanel(const int playerIndex, const char* name, const bool bShow, KeyValues* data)
1619
{
17-
CBasePlayer* pPlayer = UTIL_PlayerByIndex(playerIndex);
20+
CBasePlayer* pPlayer = Utils::PlayerByIndex(playerIndex);
1821
if (!pPlayer)
1922
{
2023
Log(WARNING, false, "Couldn't get player to display view port panel to! playerIndex: %i", playerIndex);
2124
return;
2225
}
23-
static auto ShowViewPortPanel_ = reinterpret_cast<void(__thiscall*)(CBasePlayer*, const char*, bool, KeyValues*)>(Memory::Scan<void*>(SERVER, "55 8B EC 83 EC 20 53 56 8B F1 57 8D 4D ? E8 ? ? ? ? 56"));
24-
ShowViewPortPanel_(pPlayer, name, bShow, data);
26+
static auto showViewPortPanel = reinterpret_cast<void(__thiscall*)(CBasePlayer*, const char*, bool, KeyValues*)>(Memory::Scan<void*>(SERVER, "55 8B EC 83 EC 20 53 56 8B F1 57 8D 4D ? E8 ? ? ? ? 56"));
27+
showViewPortPanel(pPlayer, name, bShow, data);
2528
}

src/modules/cbaseplayer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77

88
#pragma once
99

10+
class KeyValues;
11+
1012
class CBasePlayer
1113
{
1214
public: // MARK: CBasePlayer Public Members
1315
#pragma region Public Members
1416

15-
void CBasePlayer::ShowViewPortPanel(const int playerIndex, const char* name, const bool bShow, KeyValues* data);
17+
static void ShowViewPortPanel(int playerIndex, const char* name, bool bShow, KeyValues* data);
1618

1719
#pragma endregion
1820

0 commit comments

Comments
 (0)