Quote:
Originally Posted by nosoop
Yeah; that's what I figured -- DeathNotice does a lot.
It does, actually: CTFPlayer::FeignDeath() calls g_pGameRules->DeathNotice right before the call to CTFPlayer::ShouldDropAmmoPack; g_pGameRules gets dereferenced then calls it virtually (listed as call dword ptr [edx+14Ch], or a call to vtable offset 83).
A virtual gamerules SDKCall should work, theoretically.
|
So, something like:
PHP Code:
// GAMEDATA
"CTFGameRules::DeathNotice"
{
"library" "server"
"linux" "@_ZN12CTFGameRules11DeathNoticeEP11CBasePlayerRK15CTakeDamageInfoPKc"
"windows" "\x55\x8B\x2A\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x2A\x2A\x8B\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A"
}
// PLUGIN
StartPrepSDKCall(SDKCall_Entity);
if (!PrepSDKCall_SetFromConf(hConf, SDKConf_Signature, "CTFGameRules::DeathNotice"))
{
SetFailState("[SM] Failed to set AC-DR CTFGameRules::DeathNotice from config!");
}
PrepSDKCall_AddParameter(SDKType_CBasePlayer, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain);
Handle hDeathNotice = EndPrepSDKCall();
int tf_gamerules = FindEntityByClassname(-1, "tf_gamerules");
if (IsValidEntity(tf_gamerules))
SDKCall(hDeathNotice, tf_gamerules, client);
...or do I have to find something in the binary again?
__________________