View Single Post
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 11-13-2021 , 12:40   Re: m_hViewModel is nullptr afer updating sourcemod
Reply With Quote #3

I retrieve m_hViewModel via an extension.
If I do it in an smx plugin this way:
PHP Code:
int viewModel GetEntPropEnt(clientProp_Send"m_hViewModel"); 
It works and returns correct index,
But in the extension I do it this way:
PHP Code:
unsigned int offset;
sm_sendprop_info_t info
if(gamehelpers->FindSendPropInfo("CCSPlayer""m_hViewModel", &info))
{
    
offset info.actual_offset;

And the returned offset is 0. (In 1.10 it prints correct offset: "InitProp m_hViewModel, 4056")
Strange thing is that the offsets are correct for all the other properties which I retrieve. Looks like FindSendPropInfo was partially broken in 1.11.

Creating a C++ reproducible example is not a trivial thing, I might find some time in future, for now I see the only way to avoid this problem is downgrading to 1.10


In netprops m_hViewModel is defined two times, it might be the reason why FindSendPropInfo can't get the offset for it.
https://gist.github.com/saul/766b8f8...553cd708db6338
Attached Files
File Type: txt offsets.txt (3.1 KB, 38 views)

Last edited by kadet.89; 11-13-2021 at 12:49.
kadet.89 is offline
Send a message via Skype™ to kadet.89