Skip to content

[VSCRIPT] CNetPropManager is nonfunctional #175

Closed

Description

@samisalreadytaken

Describe the bug

Non-networked and embedded fields are not found, some return invalid values, some work fine. Further testing is required for details.

Steps to reproduce

local ent = SpawnEntityFromTable( "prop_physics",
{
	model = "models/roller.mdl"
	origin = Vector(64,64,64)
} );
ent.SetHealth( 0xCC );

printf("CPhysicsProp %s\n", ""+ent);

// CBaseEntity
printf( "m_iHealth: 0x%X [0x%X]\n", // NOT in SendTable
	NetProps.GetPropInt( ent, "m_iHealth" ),
	ent.GetHealth() );

printf( "m_vecOrigin: %s [%s]\n",
	""+NetProps.GetPropVector( ent, "m_vecOrigin" ),
	""+ent.GetOrigin() );

printf( "m_lifeState: %i\n", // NOT in SendTable
	NetProps.GetPropInt( ent, "m_lifeState" ) );

printf( "movetype: %i [%i]\n",
	NetProps.GetPropInt( ent, "movetype" ),
	ent.GetMoveType() );

printf( "m_iTeamNum: %i [%i]\n",
	NetProps.GetPropInt( ent, "m_iTeamNum" ),
	ent.GetTeam() );

// CPhysicsProp
printf( "m_bAwake: %i\n",
	NetProps.GetPropInt( ent, "m_bAwake" ) );

printf( "m_damageType: %i\n", // NOT in SendTable
	NetProps.GetPropInt( ent, "m_damageType" ) );


ent = Entities.GetLocalPlayer();
printf("\nCBasePlayer %s\n", ""+ent);

// CBaseEntity
ent.SetHealth( 0xCC );
printf( "m_iHealth: 0x%X [0x%X]\n",
	NetProps.GetPropInt( ent, "m_iHealth" ),
	ent.GetHealth() );

printf( "m_vecOrigin: %s [%s]\n",
	""+NetProps.GetPropVector( ent, "m_vecOrigin" ),
	""+ent.GetOrigin() );

printf( "m_lifeState: %i\n",
	NetProps.GetPropInt( ent, "m_lifeState" ) );

printf( "movetype: %i [%i]\n",
	NetProps.GetPropInt( ent, "movetype" ),
	ent.GetMoveType() );

printf( "m_iTeamNum: %i [%i]\n",
	NetProps.GetPropInt( ent, "m_iTeamNum" ),
	ent.GetTeam() );

// CBasePlayer
printf( "m_iFOV: %i [%i]\n",
	NetProps.GetPropInt( ent, "m_iFOV" ),
	ent.GetFOV() );

printf( "m_nButtons: %i [%i]\n", // NOT in SendTable
	NetProps.GetPropInt( ent, "m_nButtons" ),
	ent.GetButtons() );

printf( "m_ArmorValue: %i [%i]\n", // NOT in SendTable
	NetProps.GetPropInt( ent, "m_ArmorValue" ),
	ent.GetArmor() );

printf( "m_bitsHUDDamage: %i\n", // NOT in SendTable
	NetProps.GetPropInt( ent, "m_bitsHUDDamage" ) );

// CHL2_Player
printf( "m_bSprintEnabled: %i\n", // NOT in SendTable
	NetProps.GetPropInt( ent, "m_bSprintEnabled" ) );

printf( "m_fIsSprinting: %i\n",
	NetProps.GetPropInt( ent, "m_fIsSprinting" ) );

// CBasePlayer embedded
printf( "pl.deadflag: %i\n",
	NetProps.GetPropInt( ent, "pl.deadflag" ) );

printf( "m_Local.m_bDucked: %i\n",
	NetProps.GetPropInt( ent, "m_Local.m_bDucked" ) );

printf( "m_Local.m_bWearingSuit: %i\n",
	NetProps.GetPropInt( ent, "m_Local.m_bWearingSuit" ) );

Output:

CPhysicsProp ([32] prop_physics)
m_iHealth: 0xFFFFFFFF [0xCC]
m_vecOrigin: (Vector 046168B4 [64.000000 64.000000 64.000000]) [(Vector 046168B4 [64.000000 64.000000 64.000000])]
m_lifeState: -1
movetype: -65530 [6] // 4 bits, should be (-65530 & 0xFFFF)
m_iTeamNum: 0 [0]
m_bAwake: -2147483648 // 1 bit, should be 0
m_damageType: -1

CBasePlayer ([1] player)
m_iHealth: 0xCC [0xCC]
m_vecOrigin: (Vector 045FEFF4 [39.583981 -18.168600 0.031250]) [(Vector 045FEFF4 [39.583981 -18.168600 0.031250])]
m_lifeState: 512 // 3 bits, should be 0
movetype: -65534 [2] // 4 bits, should be (-65534 & 0xFFFF)
m_iTeamNum: 0 [0]
m_iFOV: 0 [90] // this is correct
m_nButtons: -1 [8]
m_ArmorValue: -1 [0]
m_bitsHUDDamage: -1
m_bSprintEnabled: -1
m_fIsSprinting: 256 // 1 bit, should be 0
pl.deadflag: -1
m_Local.m_bDucked: -1
m_Local.m_bWearingSuit: -1

Activity

  1. added
    Bug
    VScript
    on Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugVScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions