mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 05:45:36 +03:00
test fix for bug am44973 (knife headshots)
This commit is contained in:
parent
3720810b61
commit
020b3a5963
@ -11,6 +11,7 @@
|
||||
#define CSW_HEGRENADE 4
|
||||
#define CSW_C4 6
|
||||
#define CSW_SMOKEGRENADE 9
|
||||
#define CSW_KNIFE 29
|
||||
#define CSW_FLASHBANG 25
|
||||
|
||||
// *****************************************************
|
||||
|
@ -2773,7 +2773,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_FindLibrary(NULL, LibType_Class);
|
||||
MF_AddLibraries(NULL, LibType_Class, NULL);
|
||||
MF_RemoveLibraries(NULL);
|
||||
MF_OverrideNatives(NULL);
|
||||
MF_OverrideNatives(NULL, "");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -43,7 +43,6 @@ int gmsgResetHUD;
|
||||
int gmsgAmmoX;
|
||||
int gmsgScoreInfo;
|
||||
int gmsgAmmoPickup;
|
||||
|
||||
int gmsgSendAudio;
|
||||
int gmsgTextMsg;
|
||||
int gmsgBarTime;
|
||||
@ -62,26 +61,27 @@ cvar_t* csstats_pause;
|
||||
cvar_t init_csstats_rankbots ={"csstats_rankbots","1"};
|
||||
cvar_t init_csstats_pause = {"csstats_pause","0"};
|
||||
|
||||
struct sUserMsg {
|
||||
struct sUserMsg
|
||||
{
|
||||
const char* name;
|
||||
int* id;
|
||||
funEventCall func;
|
||||
bool endmsg;
|
||||
} g_user_msg[] = {
|
||||
{ "CurWeapon" , &gmsgCurWeapon , Client_CurWeapon, false },
|
||||
{ "Damage" , &gmsgDamage,Client_Damage, false },
|
||||
{ "Damage" , &gmsgDamageEnd, Client_Damage_End, true },
|
||||
{ "WeaponList" , &gmsgWeaponList, Client_WeaponList, false },
|
||||
{ "ResetHUD" , &gmsgResetHUD,Client_ResetHUD, true },
|
||||
{ "AmmoX" , &gmsgAmmoX, Client_AmmoX , false },
|
||||
{ "ScoreInfo" , &gmsgScoreInfo, Client_ScoreInfo, false },
|
||||
{ "AmmoPickup" , &gmsgAmmoPickup, Client_AmmoPickup , false },
|
||||
{"CurWeapon", &gmsgCurWeapon, Client_CurWeapon, false},
|
||||
{"Damage", &gmsgDamage, Client_Damage, false},
|
||||
{"Damage", &gmsgDamageEnd, Client_Damage_End, true},
|
||||
{"WeaponList", &gmsgWeaponList, Client_WeaponList, false},
|
||||
{"ResetHUD", &gmsgResetHUD, Client_ResetHUD, true},
|
||||
{"AmmoX", &gmsgAmmoX, Client_AmmoX, false},
|
||||
{"ScoreInfo", &gmsgScoreInfo, Client_ScoreInfo, false},
|
||||
{"AmmoPickup", &gmsgAmmoPickup, Client_AmmoPickup, false},
|
||||
{"SendAudio", &gmsgSendAudio, Client_SendAudio, false},
|
||||
{"TextMsg", &gmsgTextMsg, Client_TextMsg, false},
|
||||
{"BarTime", &gmsgBarTime, Client_BarTime, false},
|
||||
{"DeathMsg", &gmsgDeathMsg, Client_DeathMsg, false},
|
||||
|
||||
{ "SendAudio" , &gmsgSendAudio , Client_SendAudio , false },
|
||||
{ "TextMsg" , &gmsgTextMsg , Client_TextMsg , false },
|
||||
{ "BarTime" , &gmsgBarTime , Client_BarTime , false },
|
||||
|
||||
{ 0 , 0,0,false }
|
||||
{0, 0, 0, false}
|
||||
};
|
||||
|
||||
int RegUserMsg_Post(const char *pszName, int iSize)
|
||||
@ -330,10 +330,20 @@ void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/flo
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
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) )&&ptr->iHitgroup)
|
||||
GET_PLAYER_POINTER(e)->aiming = ptr->iHitgroup;
|
||||
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))
|
||||
&& ptr->iHitgroup)
|
||||
{
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(e);
|
||||
if (pPlayer->current != CSW_KNIFE)
|
||||
{
|
||||
pPlayer->aiming = ptr->iHitgroup;
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@
|
||||
#define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
|
@ -88,10 +88,10 @@ void Client_AmmoPickup(void*);
|
||||
void Client_Damage_End(void*);
|
||||
void Client_ScoreInfo(void*);
|
||||
void Client_ResetHUD(void*);
|
||||
|
||||
void Client_SendAudio(void*);
|
||||
void Client_TextMsg(void*);
|
||||
void Client_BarTime(void*);
|
||||
void Client_DeathMsg(void*);
|
||||
|
||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
||||
bool isModuleActive();
|
||||
|
@ -17,6 +17,44 @@ void Client_ResetHUD(void* mValue){
|
||||
}
|
||||
}
|
||||
|
||||
void Client_DeathMsg(void *mValue)
|
||||
{
|
||||
static int killer_id;
|
||||
static int victim_id;
|
||||
static int is_headshot;
|
||||
const char *name;
|
||||
|
||||
switch (mState++)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
killer_id = *(int *)mValue;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
victim_id = *(int *)mValue;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
is_headshot = *(int *)mValue;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = (const char *)mValue;
|
||||
if (killer_id
|
||||
&& (strcmp(name, "knife") == 0))
|
||||
{
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(killer_id);
|
||||
pPlayer->aiming = is_headshot ? 1 : 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client_WeaponList(void* mValue){
|
||||
static int wpnList;
|
||||
static int iSlot;
|
||||
|
Loading…
Reference in New Issue
Block a user