diff --git a/dlls/cstrike/CstrikePlayer.cpp b/dlls/cstrike/CstrikePlayer.cpp index 44fd7e7b..90949a93 100755 --- a/dlls/cstrike/CstrikePlayer.cpp +++ b/dlls/cstrike/CstrikePlayer.cpp @@ -11,7 +11,9 @@ CCstrikePlayer::CCstrikePlayer() { - Initialize(); + modelled = false; + inspectModel = false; + online = false; } bool CCstrikePlayer::GetModelled() diff --git a/dlls/cstrike/cstrike.cpp b/dlls/cstrike/cstrike.cpp index e2d556aa..e846db50 100755 --- a/dlls/cstrike/cstrike.cpp +++ b/dlls/cstrike/cstrike.cpp @@ -123,7 +123,7 @@ static cell AMX_NATIVE_CALL cs_get_user_money(AMX *amx, cell *params) // cs_get_ } // Return money - return (int)*((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY); + return *((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY); } static cell AMX_NATIVE_CALL cs_get_user_deaths(AMX *amx, cell *params) // cs_get_user_deaths(index); = 1 param @@ -1329,8 +1329,6 @@ void ClientDisconnect(edict_t *pEntity) { void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer) { int index = ENTINDEX(pEntity); - if (!g_players[index].GetOnline()) - g_players[index].SetOnline(true); if(g_players[index].GetModelled() && pEntity->v.deadflag == DEAD_NO) { RETURN_META(MRES_SUPERCEDE); @@ -1362,6 +1360,27 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi return(TRUE); } +/****GetEntityAPI2_Post**********************************************************/ +void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) { + int index = ENTINDEX(pEntity); + if (!g_players[index].GetOnline()) + g_players[index].SetOnline(true); + + RETURN_META(MRES_IGNORED); +} + +DLL_FUNCTIONS gFunctionTable_Post; +C_DLLEXPORT int GetEntityAPI2_Post( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ) { + gFunctionTable_Post.pfnClientUserInfoChanged = ClientUserInfoChanged_Post; + + if(*interfaceVersion!=INTERFACE_VERSION) { + LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); + *interfaceVersion = INTERFACE_VERSION; + return(FALSE); + } + memcpy( pFunctionTable, &gFunctionTable_Post, sizeof( DLL_FUNCTIONS ) ); + return(TRUE); +} /******************************************************************************************/ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) { *pPlugInfo = &Plugin_info; @@ -1384,6 +1403,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m } gMetaFunctionTable.pfnGetEntityAPI2 = GetEntityAPI2; + gMetaFunctionTable.pfnGetEntityAPI2_Post = GetEntityAPI2_Post; gMetaFunctionTable.pfnGetEngineFunctions = GetEngineFunctions; memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS)); diff --git a/dlls/cstrike/cstrike.dsp b/dlls/cstrike/cstrike.dsp index 7c7ab3fe..74ff0892 100755 --- a/dlls/cstrike/cstrike.dsp +++ b/dlls/cstrike/cstrike.dsp @@ -56,7 +56,7 @@ LINK32=link.exe # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # Begin Special Build Tool SOURCE="$(InputPath)" -PostBuild_Cmds=echo Copying dll... copy Release\cstrike.dll K:\S\cstrike\addons\amxx\modules\cstrike_amx.dll echo Copying inc... copy ..\plugins\include\cstrike.inc K:\S\cstrike\addons\amxx\scripting\include\ +PostBuild_Cmds=echo Copying dll... copy Release\cstrike.dll K:\S\cstrike\addons\amxx\modules\cstrike_amx.dll echo Copying inc... copy ..\plugins\include\cstrike.inc K:\S\cstrike\addons\amxx\scripting\include\ # End Special Build Tool !ELSEIF "$(CFG)" == "cstrike - Win32 Debug" @@ -83,7 +83,11 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/cstrike_amx_debug.dll" /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/cstrike_amx.dll" /pdbtype:sept +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds=copy Debug/cstrike_amx.dll k:\s\cstrike\addons\amxx\modules\ copy ..\plugins\include\cstrike.inc k:\s\cstrike\addons\amxx\scripting\include\ +# End Special Build Tool !ENDIF