make ragdolls/ghosts ignore bullets/stabs
This commit is contained in:
parent
303132ef42
commit
bdb8b4e845
@ -321,6 +321,7 @@ bool ShouldHitEntity(IHandleEntity *pHandleEntity, int contentsMask)
|
|||||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char lifeState = 0;
|
||||||
if(!iTeam)
|
if(!iTeam)
|
||||||
{
|
{
|
||||||
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(index);
|
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(index);
|
||||||
@ -332,9 +333,21 @@ bool ShouldHitEntity(IHandleEntity *pHandleEntity, int contentsMask)
|
|||||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||||
|
|
||||||
iTeam = pInfo->GetTeamIndex();
|
iTeam = pInfo->GetTeamIndex();
|
||||||
|
|
||||||
|
static int offset = 0;
|
||||||
|
if(!offset)
|
||||||
|
{
|
||||||
|
sm_sendprop_info_t spi;
|
||||||
|
if (!gamehelpers->FindSendPropInfo("CBasePlayer", "m_lifeState", &spi))
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||||
|
|
||||||
|
offset = spi.actual_offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
lifeState = *(char *)((uint8_t *)pHandleEntity + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iTeam == g_FireBulletPlayerTeam)
|
if(iTeam == g_FireBulletPlayerTeam || lifeState != 0)
|
||||||
RETURN_META_VALUE(MRES_SUPERCEDE, false);
|
RETURN_META_VALUE(MRES_SUPERCEDE, false);
|
||||||
|
|
||||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user