From 656d30be8380263ec81c9408b8eff59f5e15a3be Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 13 Nov 2007 01:44:17 +0000 Subject: [PATCH] fixed amb1096 --- dlls/cstrike/csx/meta_api.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/cstrike/csx/meta_api.cpp b/dlls/cstrike/csx/meta_api.cpp index f5c42512..8900f5de 100755 --- a/dlls/cstrike/csx/meta_api.cpp +++ b/dlls/cstrike/csx/meta_api.cpp @@ -174,7 +174,15 @@ void ServerDeactivate() { } BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ){ - GET_PLAYER_POINTER(pEntity)->Connect(pszAddress); + CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity); + + if (pPlayer->pEdict == NULL) + { + pPlayer->Init(ENTINDEX(pEntity), pEntity); + } + + pPlayer->Connect(pszAddress); + RETURN_META_VALUE(MRES_IGNORED, TRUE); } @@ -191,6 +199,12 @@ void ClientPutInServer_Post( edict_t *pEntity ) { void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) { CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity); + + if (pPlayer->pEdict == NULL) + { + pPlayer->Init(ENTINDEX(pEntity), pEntity); + } + const char* name = INFOKEY_VALUE(infobuffer,"name"); const char* oldname = STRING(pEntity->v.netname);