diff --git a/dlls/tfc/tfcx/CMisc.h b/dlls/tfc/tfcx/CMisc.h index 9839ae97..57423df3 100755 --- a/dlls/tfc/tfcx/CMisc.h +++ b/dlls/tfc/tfcx/CMisc.h @@ -18,7 +18,7 @@ #define PD_SENTRY_OWNER 83 + LINUXOFFSET #define PD_TIMER_OWNER 932 + LINUXOFFSET -#define MAX_TRACE 14 // +1 // timer +#define MAX_TRACE 13 //#define NADE_OFFSET 24 @@ -99,9 +99,12 @@ struct weaponsVault { struct traceVault { char * szName; + char * szTa; int iId; int iAction; float fDel; + int start; + int stop; }; diff --git a/dlls/tfc/tfcx/Utils.cpp b/dlls/tfc/tfcx/Utils.cpp index 22fb0403..0672675a 100755 --- a/dlls/tfc/tfcx/Utils.cpp +++ b/dlls/tfc/tfcx/Utils.cpp @@ -33,21 +33,19 @@ #include "tfcx.h" traceVault traceData[] = { - { "tf_gl_grenade", TFC_WPN_GL, ACT_NADE_PUT, 2.0 }, - { "tf_gl_pipebomb", TFC_WPN_PL, ACT_NADE_PUT, 2.0 }, - { "tf_weapon_normalgrenade", TFC_WPN_NORMALGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 }, - { "tf_weapon_nailgrenade", TFC_WPN_NAILGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 }, - { "tf_weapon_mirvgrenade", TFC_WPN_MIRVGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 }, - { "tf_weapon_napalmgrenade", TFC_WPN_NAPALMGRENADE, ACT_NADE_SHOT, 0.0 }, - { "tf_weapon_gasgrenade", TFC_WPN_GASGRENADE, ACT_NADE_SHOT, 0.0 }, - { "tf_weapon_empgrenade", TFC_WPN_EMPGRENADE, ACT_NADE_SHOT, 0.0 }, - { "tf_weapon_mirvbomblet", TFC_WPN_MIRVGRENADE,ACT_NADE_PUT, 2.0 }, - { "tf_rpg_rocket", TFC_WPN_RPG,ACT_NADE_PUT, 2.0 }, - { "caltrop", TFC_WPN_CALTROP, ACT_NADE_SHOT,0.0 }, - { "tf_weapon_concussiongrenade", TFC_WPN_CONCUSSIONGRENADE, ACT_NADE_NONE, 0.0 }, - - // { "timer", TFC_WPN_TIMER,ACT_NADE_NONE, 2.0 }, - + { "timer","ti", TFC_WPN_TIMER,ACT_NADE_NONE, 2.0 , 0 , 2 }, + { "caltrop","ca", TFC_WPN_CALTROP, ACT_NADE_SHOT,0.0 , 0 , 2 }, + { "tf_rpg_rocket","roc", TFC_WPN_RPG,ACT_NADE_PUT, 2.0 , 7 , 3 }, + { "tf_gl_grenade","gl_g", TFC_WPN_GL, ACT_NADE_PUT, 2.0 , 3 , 4 }, + { "tf_gl_pipebomb","gl_p", TFC_WPN_PL, ACT_NADE_PUT, 2.0 , 3 , 4 }, + { "tf_weapon_gasgrenade","ga", TFC_WPN_GASGRENADE, ACT_NADE_SHOT, 0.0 , 10 , 2 }, + { "tf_weapon_empgrenade","em", TFC_WPN_EMPGRENADE, ACT_NADE_SHOT, 0.0 , 10 , 2 }, + { "tf_weapon_mirvbomblet","mirvb", TFC_WPN_MIRVGRENADE,ACT_NADE_PUT, 2.0 , 10 , 5 }, + { "tf_weapon_nailgrenade","nai", TFC_WPN_NAILGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 , 10 , 3 }, + { "tf_weapon_mirvgrenade","mirvg", TFC_WPN_MIRVGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 , 10 , 5 }, + { "tf_weapon_napalmgrenade","nap", TFC_WPN_NAPALMGRENADE, ACT_NADE_SHOT, 0.0 , 10 , 3 }, + { "tf_weapon_normalgrenade","no", TFC_WPN_NORMALGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 , 10 , 2 }, + { "tf_weapon_concussiongrenade","co", TFC_WPN_CONCUSSIONGRENADE, ACT_NADE_NONE, 0.0 , 10 , 2 }, }; bool ignoreBots (edict_t *pEnt, edict_t *pOther){ @@ -62,6 +60,16 @@ bool isModuleActive(){ return false; } +bool util_strncmp( const char *sz1, const char *sz2, int size){ + int i = 0; + while( sz1[i] && i<=size){ + if ( sz1[i] != sz2[i] ) + return false; + i++; + } + return true; +} + /* medikit,iSlot:-1,iId:3 spanner,iSlot:2,iId:4 diff --git a/dlls/tfc/tfcx/moduleconfig.cpp b/dlls/tfc/tfcx/moduleconfig.cpp index 3fc8ab18..5a73dabe 100755 --- a/dlls/tfc/tfcx/moduleconfig.cpp +++ b/dlls/tfc/tfcx/moduleconfig.cpp @@ -137,7 +137,7 @@ void PlayerPreThink_Post( edict_t *pEntity ) { if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time && pPlayer->ingame){ - if ( !ignoreBots(pEntity) ){ + if ( !ignoreBots(pEntity,NULL) ){ pPlayer->clearStats = 0.0f; pPlayer->rank->updatePosition( &pPlayer->life ); pPlayer->restartStats(false); @@ -290,8 +290,7 @@ void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t * CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner); for ( int i=0;iv.classname)) == 0 ){ - + if ( util_strncmp( traceData[i].szName,traceData[i].start ? STRING(e->v.classname)+traceData[i].start : STRING(e->v.classname) ,traceData[i].stop) ){ if ( traceData[i].iAction & ACT_NADE_SHOT ){ pPlayer->saveShot(traceData[i].iId); } diff --git a/dlls/tfc/tfcx/msvc/tfcx.dsp b/dlls/tfc/tfcx/msvc/tfcx.dsp index b9f76725..ad186573 100755 --- a/dlls/tfc/tfcx/msvc/tfcx.dsp +++ b/dlls/tfc/tfcx/msvc/tfcx.dsp @@ -53,7 +53,7 @@ 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 /machine:I386 -# 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 /def:".\tfcx.def" /out:"release/tfcx_amx.dll" +# 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 /out:"release/tfcx_amxx.dll" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "tfcx - Win32 Debug" diff --git a/dlls/tfc/tfcx/tfcx.h b/dlls/tfc/tfcx/tfcx.h index cd832054..2309d989 100755 --- a/dlls/tfc/tfcx/tfcx.h +++ b/dlls/tfc/tfcx/tfcx.h @@ -103,6 +103,7 @@ void Client_ResetHUD(void*); bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL ); bool isModuleActive(); +bool util_strncmp( const char *sz1, const char *sz2, int size); #endif // TFCX_H