Skip to content

Commit 09f6527

Browse files
committed
fix: Corrected some code styling and added some comments
1 parent e91b380 commit 09f6527

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

commands.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,15 @@ void RemovePlayerUI(const int playerIndex, const bool bBanning)
554554
return;
555555
}
556556

557+
// TODO: Fix to show gameui or at some point replace with ImGUI.
557558
engineClient->ExecuteClientCmd("gameui_activate"); // Doesn't work for some reason although it does for the first run prompt.
559+
//! Below crasehs due to a issue with ExecuteStringCommand.
558560
//CGameClient__ExecuteStringCommand(CBaseServer__GetClient(playerIndex), "gameui_activate");
559561
std::vector<RemovePlayerInfo> userList;
560562
FOR_ALL_PLAYERS(i)
561563
{
562-
if (i == 1) continue; // Don't add host to button options.
564+
if (i == 1)
565+
continue; // Don't add host to button options.
563566
player_info_t playerInfo;
564567
engineServer->GetPlayerInfo(i, &playerInfo);
565568
RemovePlayerInfo curUserInfo;

sdk.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ void CPortal_Player__SetFlashlightState(const int playerIndex, const bool enable
298298
//---------------------------------------------------------------------------------
299299
IClient* CBaseServer__GetClient(const int playerIndex)
300300
{
301-
if (!UTIL_PlayerByIndex(playerIndex)) return nullptr;
301+
if (!UTIL_PlayerByIndex(playerIndex))
302+
return nullptr;
302303

303304
static auto GetClient_ = reinterpret_cast<IClient * (__thiscall*)(CBaseServer*, int)>(Memory::Scanner::Scan(ENGINEDLL, "55 8B EC 8B 81 ?? ?? ?? ?? 8B 4D ?? 8B 04 88"));
304305
return GetClient_(g_P2MMServerPlugin.sv, playerIndex);
@@ -311,7 +312,8 @@ IClient* CBaseServer__GetClient(const int playerIndex)
311312
//---------------------------------------------------------------------------------
312313
bool CGameClient__ExecuteStringCommand(IClient* client, const char* pCommandString)
313314
{
314-
if (!client) return false;
315+
if (!client)
316+
return false;
315317

316318
static auto ExecuteStringCommand_ = reinterpret_cast<bool(__thiscall*)(IClient*, const char*)>(Memory::Scanner::Scan(ENGINEDLL, "55 8B EC 81 EC 08 05 00 00 56 8B 75"));
317319
return ExecuteStringCommand_(client, pCommandString);

0 commit comments

Comments
 (0)