IntersectSegment hook causing weird results?
Code:
bool PatchedIntersectSegment(IntersectQuery& Query, IntersectInfo* Info) {
DWORD CShellBase = reinterpret_cast<DWORD>(GetModuleHandle("CShell.dll"));
DWORD LTClientShell = *reinterpret_cast<DWORD*>(CShellBase + aLTClientShell);
CFPlayer* MyPlayer = GetPlayerFromIndex(LTClientShell, GetMyPlayersIndex(LTClientShell));
if (IsValidPlayer(MyPlayer, true) && ((MyPlayer -> Health) > 0)) {
for (int ThisPlayerIndex = 0; (ThisPlayerIndex < 16); ThisPlayerIndex++) {
CFPlayer* OtherPlayer = GetPlayerFromIndex(LTClientShell, ThisPlayerIndex);
if (IsValidPlayer(OtherPlayer, false) && !IsMe(MyPlayer, OtherPlayer) && !IsTeammate(MyPlayer, OtherPlayer)) {
D3DXVECTOR3 HitPosition = GetBonePosition((OtherPlayer -> Object), 6);
Query.StartPosition = (HitPosition + D3DXVECTOR3(0.0f, 50.0f, 0.0f));
Query.EndPosition = (HitPosition - D3DXVECTOR3(0.0f, 50.0f, 0.0f));
Query.CollisionFlags = (INTERSECT_OBJECTS | IGNORE_NONSOLID | INTERSECT_HPOLY);
Query.ObjectFilterOne = FilterObjectsCallback;
(Info -> ImpactObject) = (OtherPlayer -> Object);
(Info -> ImpactPosition) = HitPosition;
return true;
};
};
};
return OriginalIntersectSegment(Query, Info);
};
However, even though it displays a red player name on my screen, even if I actually am aiming at them - I don't deal any damage.
Help? Just trying to setup a simple remote kill...

