diff --git a/dlls/tfc/tfcx/CMisc.h b/dlls/tfc/tfcx/CMisc.h index d369901d..9839ae97 100755 --- a/dlls/tfc/tfcx/CMisc.h +++ b/dlls/tfc/tfcx/CMisc.h @@ -92,7 +92,7 @@ enum { struct weaponsVault { char* name; - char fullName[32]; + char* logName; short int ammoSlot; bool melee; }; diff --git a/dlls/tfc/tfcx/NBase.cpp b/dlls/tfc/tfcx/NBase.cpp index e24a4582..27641770 100755 --- a/dlls/tfc/tfcx/NBase.cpp +++ b/dlls/tfc/tfcx/NBase.cpp @@ -344,7 +344,15 @@ static cell AMX_NATIVE_CALL TFC_GetWpnName(AMX *amx, cell *params) { } return MF_SetAmxString(amx,params[2],weaponData[iIndex].name,params[3]); } - + +static cell AMX_NATIVE_CALL TFC_GetWpnLogName(AMX *amx, cell *params) { + int iIndex = params[1]; + if ( iIndex < 1 || iIndex > TFCMAX_WEAPONS ){ + MF_RaiseAmxError(amx,AMX_ERR_NATIVE); + return 0; + } + return MF_SetAmxString(amx,params[2],weaponData[iIndex].logName,params[3]); +} static cell AMX_NATIVE_CALL TFC_SetPDdata(AMX *amx, cell *params) { @@ -392,6 +400,7 @@ AMX_NATIVE_INFO base_Natives[] = { {"TFC_GetWeaponBAmmo", TFC_GetWeaponBAmmo}, {"TFC_SetWeaponBAmmo", TFC_SetWeaponBAmmo}, {"TFC_GetWpnName", TFC_GetWpnName}, + {"TFC_GetWpnLogName", TFC_GetWpnLogName}, {"TFC_IsMelee", TFC_IsMelee}, {"TFC_UserKill" , TFC_UserKill}, diff --git a/dlls/tfc/tfcx/Utils.cpp b/dlls/tfc/tfcx/Utils.cpp index b4e671c6..b12c57f5 100755 --- a/dlls/tfc/tfcx/Utils.cpp +++ b/dlls/tfc/tfcx/Utils.cpp @@ -84,35 +84,35 @@ knife,iSlot:-1,iId:23 */ weaponsVault weaponData[] = { { "", "", -1 }, // 0 - { "timer", "", -1 }, // 1 - { "sentrygun", "", -1 }, // 2 - { "medikit", "", -1 , true}, - { "spanner", "", 2 , true }, - { "axe", "", -1 , true }, - { "sniperrifle", "", 1 }, - { "autorifle", "", 1 }, - { "shotgun", "", 1 }, - { "supershotgun", "", 1 }, - { "ng", "", 3 }, - { "superng", "", 3 }, - { "gl", "", 4 }, + { "timer", "infection", -1 }, // 1 + { "sentrygun", "sentrygun", -1 }, // 2 + { "medikit", "medikit", -1 , true}, + { "spanner", "spanner", 2 , true }, + { "axe", "axe", -1 , true }, + { "sniperrifle", "sniperrifle", 1 }, + { "autorifle", "autorifle", 1 }, + { "shotgun", "shotgun", 1 }, + { "supershotgun", "supershotgun", 1 }, + { "ng", "nails", 3 }, + { "superng", "supernails", 3 }, + { "gl", "gl_grenade", 4 }, { "flamethrower", "", 2 }, - { "rpg", "", 4 }, - { "ic", "", 4 }, - { "flames", "", -1 }, // 16 - { "ac", "", 1 }, + { "rpg", "rocket", 4 }, + { "ic", "ic", 4 }, + { "flames", "flames", -1 }, // 16 + { "ac", "ac", 1 }, { "", "", -1 }, // 18 { "", "", -1 }, // 19 - { "tranq", "", 1 }, - { "railgun", "", 3 }, - { "pl", "", 4 }, - { "knife", "", -1 , true }, - { "caltrop", "", -1 }, // 24 - { "concussion", "", -1 }, - { "grenade", "", -1 }, - { "nailgrenade", "", -1 }, - { "mirvgrenade", "", -1 }, - { "napalm", "", -1 }, - { "gas", "", -1 }, - { "emp", "", -1 }, + { "tranq", "tranq", 1 }, + { "railgun", "railgun", 3 }, + { "pl", "pipebomb", 4 }, + { "knife", "knife", -1 , true }, + { "caltrop", "caltrop", -1 }, // 24 + { "concussion", "concussiongrenade", -1 }, + { "grenade", "normalgrenade", -1 }, + { "nailgrenade", "nailgrenade", -1 }, + { "mirvgrenade", "mirvgrenade", -1 }, + { "napalm", "napalmgrenade", -1 }, + { "gas", "gasgrenade", -1 }, + { "emp", "empgrenade", -1 }, }; diff --git a/dlls/tfc/tfcx/moduleconfig.cpp b/dlls/tfc/tfcx/moduleconfig.cpp index f9736fa8..3fc8ab18 100755 --- a/dlls/tfc/tfcx/moduleconfig.cpp +++ b/dlls/tfc/tfcx/moduleconfig.cpp @@ -278,27 +278,31 @@ void SetModel_Post(edict_t *e, const char *m){ } void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *e, TraceResult *ptr) { - if (ptr->pHit&&(ptr->pHit->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&& - e&&(e->v.flags& (FL_CLIENT | FL_FAKECLIENT) )){ - GET_PLAYER_POINTER(e)->aiming = ptr->iHitgroup; + if ( !e ) RETURN_META(MRES_IGNORED); - } - if ( e->v.owner && e->v.owner->v.flags& (FL_CLIENT | FL_FAKECLIENT) ){ - CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner); - for ( int i=0;iv.classname)) == 0 ){ - if ( traceData[i].iAction & ACT_NADE_SHOT ){ - pPlayer->saveShot(traceData[i].iId); + if (ptr->pHit&&(ptr->pHit->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&& + (e->v.flags& (FL_CLIENT | FL_FAKECLIENT) )){ + GET_PLAYER_POINTER(e)->aiming = ptr->iHitgroup; + } + else{ + if ( e->v.owner && e->v.owner->v.flags& (FL_CLIENT | FL_FAKECLIENT) ){ + CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner); + + for ( int i=0;iv.classname)) == 0 ){ + + if ( traceData[i].iAction & ACT_NADE_SHOT ){ + pPlayer->saveShot(traceData[i].iId); + } + if ( traceData[i].iAction & ACT_NADE_PUT ){ + g_grenades.put(e,traceData[i].fDel,traceData[i].iId,GET_PLAYER_POINTER(e->v.owner)); + } + break; } - if ( traceData[i].iAction & ACT_NADE_PUT ){ - g_grenades.put(e,traceData[i].fDel,traceData[i].iId,GET_PLAYER_POINTER(e->v.owner)); - } - break; } } } - RETURN_META(MRES_IGNORED); } diff --git a/dlls/tfc/tfcx/usermsg.cpp b/dlls/tfc/tfcx/usermsg.cpp index 6e6bae45..c79a0dd8 100755 --- a/dlls/tfc/tfcx/usermsg.cpp +++ b/dlls/tfc/tfcx/usermsg.cpp @@ -87,9 +87,14 @@ void Client_Damage(void* mValue){ case 2: edict_t* enemy; + if ( !mPlayer || !damage ) + break; + enemy = mPlayer->pEdict->v.dmg_inflictor; - if ( !mPlayer || !damage || FNullEnt( enemy ) ) break; - + + if ( FNullEnt( enemy ) ) + break; + if (enemy->v.flags & (FL_CLIENT | FL_FAKECLIENT) ) { // attacker is player and his active weapon pAttacker = GET_PLAYER_POINTER(enemy);