Page 1 of 1

CSendProp pretty much broken - doesn't find any props.

Posted: Wed Aug 14, 2013 6:49 am
by Omega_K2
It seems CSendProp is broken. It doesn't find any property anymore, not even the most basic properties like

CBaseEntity.m_vecOrigin
CBasePlayer.m_iHealth

etc.

Btw, I suggest the message output function is changed somehow, right now it only shows the error messages if you put "developer 1" in console. Would be cool if it could throw an python exception instead, so you can actually tell where the error is coming from.

Edit: TestCase

Syntax: Select all

def Test(av):
p = av['playerinfo']
e = p.get_edict()
prop = e.get_prop('CBasePlayer.m_iHealth')
print(prop.get_int())

import k2tools.cmdlib

def load():
k2tools.cmdlib.AdvancedCommandManager.register('test',
callback=(Test,),
log_pre_exec=True,
log_post_exec=True,
log_spam_protect=True,
server=True,
console=True,
)

def unload():
k2tools.cmdlib.AdvancedCommandManager.unregister('test')

Posted: Wed Aug 14, 2013 9:06 am
by Ayuto
Remove the "CBasePlayer." part. This SendProp implementation does not require a full property path.

Posted: Thu Aug 15, 2013 1:26 am
by Omega_K2
Ayuto wrote:Remove the "CBasePlayer." part. This SendProp implementation does not require a full property path.


Ah, I never realized this was changed at all. Much smarter to be honest this way.

Edit: Seems like many of the data files are in need of updating now, they still contain the old values.