It might be difficult to hook this function under linux, with Orpheu and with latest HLDS version.
Because of optimization at compilation, some functions in game binary are split into two functions.
This means that the first part will be called from some specific functions and part two by another specific functions.
The original function looks like that now:
Code:
void CBasePlayer::SetAnimation(PLAYER_ANIM playerAnim)
{
if (!pev->modelindex)
{
return;
}
if ((playerAnim == PLAYER_FLINCH || playerAnim == PLAYER_LARGE_FLINCH) && HasShield())
{
return;
}
if (!(playerAnim == PLAYER_FLINCH || playerAnim == PLAYER_LARGE_FLINCH || gpGlobals->time > m_flFlinchTime || pev->health <= 0))
{
return;
}
SetAnimation_part2(playerAnim);
}
Right now,
SetAnimation (original function) will be called only from anything related to weapon (Reload/Fire), while
SetAnimation_part2 will be called only from anything related to player (Duck/Jump/TakeDamage/Killed/PostThink).
By hooking the original function, Orpheu won't catch any player's related events.
If you want to catch all valid calls, you will need to hook
SetAnimation_part2. But that the annoying part, because the way it's split, I'm not sure Orpheu will be able to hook properly, nor retrieving function arguments. You might to create a new config file in functions/ directory (not in CBasePlayer), and with such signatures for linux:
Code:
[0x55,0x57,0x56,0x89,"*",0x53,0x89,"*",0x83,"*","*",0x8B]
Config file should be likely similar to :
Code:
{
"name" : "SetAnimation2",
"library" : "mod",
"arguments" :
[
{
"type" : "CBasePlayer *"
},
{
"type" : "PLAYER_ANIM"
}
],
"identifiers":
[
{
"os" : "linux",
"mod" : "cstrike",
"value" : [0x55,0x57,0x56,0x89,"*",0x53,0x89,"*",0x83,"*","*",0x8B]
}
]
}
No idea. Give a try.