Quote:
@HamletEagle - sorry, but yet again I switched back to CurWeapon. The guy above is a clear example that the hamsandwich method simply doesn't work properly. I had 2 other people say the same thing in another forum and it worked for them when I sent them a CurWeapon version. I don't know when and why this is happening, but it's clearly a problem. I'm pretty sure it's happening only on Linux.
|
Anecdotal evidence is just that, nothing more.
Ham_Item_Deploy is just a hook for Deploy(), which is where game sets models. That's literally how it's done inside game, there is no reason for it not to work, except really outdated game binaries. Using Ham_Item_Deploy to set models it's really not a new or fancy thing.
Example:
https://github.com/s1lentq/ReGameDLL...n_ak47.cpp#L55
If you insist that there is an issue find a way to reproduce it and get some debug logs, which should tell if the forward is even called, if the owner is retrieved sucessfully and so on.
I'm sorry but I'll have to unapprove if you wish to stick with CurWeapon, as this is not optimal.
Edit: I looked at your old code and it is wrong.
PHP Code:
new id = get_pdata_cbase(iEnt, m_pPlayer)
You forgot the linux extra offset:
PHP Code:
new id = get_pdata_cbase(iEnt, m_pPlayer, 4)
which explains why the "bug" was noticed only under linux. The extra offset is 5 only for players and grenades.
__________________