Raised This Month: $32 Target: $400
 8% 

[Metamod] VTable HookKilled()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 08-08-2015 , 22:30   [Metamod] VTable HookKilled()
Reply With Quote #1

This is working just fine under Windows. But in Linux, when the entity gets killed by a HE grenade it result to a Segmentation fault. Always.
Any idea why this just happens with HEs?
Have tried without even AMXX to make sure no plugins conflict with it.
Code:
#ifdef _WIN32 void __fastcall HookKilled( void *pthis, int i, entvars_t *pevAttacker, int iGib ) #elif __linux__ void HookKilled( void *pthis, entvars_t *pevAttacker, int iGib ) #endif {     META_CONS("HookKilled"); #ifdef _WIN32     reinterpret_cast<int (__fastcall *)(void *, int, entvars_t *, int)>(g_Killed_Hook.address)(pthis, DUMMY_VAL, pevAttacker, iGib); #elif __linux__
    reinterpret_cast<int (*)(void *, entvars_t *, int)>(g_Killed_Hook.address)(pthis, pevAttacker, iGib); // this is causing it (also tried with void* instead of int)
#endif     META_CONS("HookKilled -- continue");     edict_t* pVictim = PrivateToEdict( pthis );     if (!IsValidPev(pVictim))     {         return;     } }
Rirre is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2015 , 08:01   Re: [Metamod] VTable HookKilled()
Reply With Quote #2

Code looks good. It reminds this issue someone has under windows though : https://github.com/ValveSoftware/halflife/issues/1646

Don't you have a backtrace?
__________________
Arkshine is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 08-09-2015 , 08:51   Re: [Metamod] VTable HookKilled()
Reply With Quote #3

Had to remove the .so file since it didn't overwrite a old version I used to block every DamageType except DMG_HEGRENADE bit in TakeDamage().
Now it crashes whatever weapon I'm using when the entity should die. It's the same line in HookKilled() causing it.
Still works fine under Windows.

Too much to copy & paste in here so I attach a zipped file with the files.

Last edited by Rirre; 08-12-2015 at 11:15.
Rirre is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2015 , 10:49   Re: [Metamod] VTable HookKilled()
Reply With Quote #4

You're setting base to 0x94 and diff to 2, does it mean you're running an old HLDS version before the Steam update in 2013?
__________________
Arkshine is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 08-09-2015 , 15:29   Re: [Metamod] VTable HookKilled()
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
You're setting base to 0x94 and diff to 2, does it mean you're running an old HLDS version before the Steam update in 2013?
Aha! Just changed that and now it works. Thanks I got some help with this so no I did not set that by myself. Running the latest

Last edited by Rirre; 08-09-2015 at 15:29.
Rirre is offline
Reply


Thread Tools
Display Modes

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 11:49.


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