Quote:
Originally Posted by Fruchtzwerg
Quote:
Originally Posted by Pimp Daddy
But it I change the &= to = then it works, but that is basically erasing other data that is in that offset
|
That is because you use int pointers, but the data isn't int. Use the correct data size and it will not change other parameters.
|
How do I determine the correct data size?
this also worked after initial testing:
Code:
void CPlayer::set_user_defuser( bool bValue )
{
if( bValue )
{
*((int *)pEnt->GetUnknown() + OFFSET_ITEM) |= (1<<0);
*((int *)pEnt->GetUnknown() + OFFSET_ITEM_ICON) |= (1<<0);
}
else
{
*((int *)pEnt->GetUnknown() + OFFSET_ITEM) -= (1<<0);
*((int *)pEnt->GetUnknown() + OFFSET_ITEM_ICON) -= (1<<0);
}
}
__________________