Switch to C++11 class initializers for CPlayer.

This commit is contained in:
Nicholas Hastings 2017-06-23 10:59:03 -04:00
parent 79970ca5fa
commit 338fdb37f6
2 changed files with 16 additions and 33 deletions

View File

@ -49,7 +49,6 @@
#include <sourcemod_version.h> #include <sourcemod_version.h>
#include "smn_keyvalues.h" #include "smn_keyvalues.h"
#include "command_args.h" #include "command_args.h"
#include <ITranslator.h>
#include <bridge/include/IExtensionBridge.h> #include <bridge/include/IExtensionBridge.h>
#include <bridge/include/IScriptManager.h> #include <bridge/include/IScriptManager.h>
#include <bridge/include/ILogger.h> #include <bridge/include/ILogger.h>
@ -1936,25 +1935,8 @@ bool PlayerManager::HandleConVarQuery(QueryCvarCookie_t cookie, int client, EQue
CPlayer::CPlayer() CPlayer::CPlayer()
{ {
m_IsConnected = false;
m_IsInGame = false;
m_IsAuthorized = false;
m_pEdict = NULL;
m_Admin = INVALID_ADMIN_ID;
m_TempAdmin = false;
m_Info = NULL;
m_bAdminCheckSignalled = false;
m_UserId = -1;
m_bIsInKickQueue = false;
m_LastPassword.clear(); m_LastPassword.clear();
m_LangId = SOURCEMOD_LANGUAGE_ENGLISH;
m_bFakeClient = false;
m_bIsSourceTV = false;
m_bIsReplay = false;
m_Serial.value = -1; m_Serial.value = -1;
#if SOURCE_ENGINE == SE_CSGO
m_LanguageCookie = InvalidQueryCvarCookie;
#endif
} }
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity) void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)

View File

@ -38,6 +38,7 @@
#include <IForwardSys.h> #include <IForwardSys.h>
#include <IPlayerHelpers.h> #include <IPlayerHelpers.h>
#include <IAdminSystem.h> #include <IAdminSystem.h>
#include <ITranslator.h>
#include <sh_string.h> #include <sh_string.h>
#include <sh_list.h> #include <sh_list.h>
#include <sh_vector.h> #include <sh_vector.h>
@ -123,32 +124,32 @@ private:
bool SetEngineString(); bool SetEngineString();
bool SetCSteamID(); bool SetCSteamID();
private: private:
bool m_IsConnected; bool m_IsConnected = false;
bool m_IsInGame; bool m_IsInGame = false;
bool m_IsAuthorized; bool m_IsAuthorized = false;
bool m_bIsInKickQueue; bool m_bIsInKickQueue = false;
String m_Name; String m_Name;
String m_Ip; String m_Ip;
String m_IpNoPort; String m_IpNoPort;
ke::AString m_AuthID; ke::AString m_AuthID;
ke::AString m_Steam2Id; ke::AString m_Steam2Id;
ke::AString m_Steam3Id; ke::AString m_Steam3Id;
AdminId m_Admin; AdminId m_Admin = INVALID_ADMIN_ID;
bool m_TempAdmin; bool m_TempAdmin = false;
edict_t *m_pEdict; edict_t *m_pEdict = nullptr;
IPlayerInfo *m_Info; IPlayerInfo *m_Info = nullptr;
String m_LastPassword; String m_LastPassword;
bool m_bAdminCheckSignalled; bool m_bAdminCheckSignalled = false;
int m_iIndex; int m_iIndex;
unsigned int m_LangId; unsigned int m_LangId = SOURCEMOD_LANGUAGE_ENGLISH;
int m_UserId; int m_UserId = -1;
bool m_bFakeClient; bool m_bFakeClient = false;
bool m_bIsSourceTV; bool m_bIsSourceTV = false;
bool m_bIsReplay; bool m_bIsReplay = false;
serial_t m_Serial; serial_t m_Serial;
CSteamID m_SteamId; CSteamID m_SteamId;
#if SOURCE_ENGINE == SE_CSGO #if SOURCE_ENGINE == SE_CSGO
QueryCvarCookie_t m_LanguageCookie; QueryCvarCookie_t m_LanguageCookie = InvalidQueryCvarCookie;
#endif #endif
}; };