Raised This Month: $ Target: $400
 0% 

[SOLVED]Detour ShouldHitEntity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
keygens
Senior Member
Join Date: Mar 2010
Location: Somewhere
Old 09-19-2016 , 19:43   [SOLVED]Detour ShouldHitEntity
Reply With Quote #1

Hello. I want detour CTraceFilterSimple::ShouldHitEntity, so i found part of code in collisionhook extension thread, made by God-Tony. I want to know 1 thing - how next code is look like?I need to know how look like
g_iPassEntOffs and g_iCollisionOffs in code. I know, its offsets of contentmask and collisiongroup, but i want to know how declare it (or it just integer?).
Thanks in advance.

PHP Code:
DETOUR_DECL_MEMBER2(ShouldHitEntityboolIHandleEntity *, pHandleEntityintcontentsMask)
{
    
IHandleEntity *m_pPassEnt = *(IHandleEntity **)((intptr_t)this g_iPassEntOffs);
    
int m_collisionGroup = *(int *)((intptr_t)this g_iCollisionOffs);

    
cell_t result DETOUR_MEMBER_CALL(ShouldHitEntity)(pHandleEntitycontentsMask);

    if (!
pHandleEntity || !m_pPassEnt || pHandleEntity == m_pPassEnt)
        return (
result != 0);

    
cell_t touchEnt gamehelpers->EntityToBCompatRef((CBaseEntity *)pHandleEntity);
    
cell_t passEnt gamehelpers->EntityToBCompatRef((CBaseEntity *)m_pPassEnt);

    
g_pOnShouldCollide->PushCell(touchEnt);
    
g_pOnShouldCollide->PushCell(passEnt);
    
g_pOnShouldCollide->PushCell(m_collisionGroup);
    
g_pOnShouldCollide->PushCell(contentsMask);
    
g_pOnShouldCollide->PushCellByRef(&result);
    
g_pOnShouldCollide->Execute(NULL);

    return (
result != 0);

Need to use GETGAMEDATAOFFSET.

Last edited by keygens; 09-19-2016 at 20:16.
keygens is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode