Skip to content

[REQ] FindSendPropInfo with array support ? To get array PropFieldType #1258

@ambaca

Description

@ambaca

Description

Feature request: FindSendPropInfo with array support ?

  • Easier way to check array PropFieldType

Problematic Code (or Steps to Reproduce)

  char cls[64];
  char prop[] = "m_hMyWeapons";

  if(HasEntProp(client, Prop_Send, "m_hMyWeapons"))
  {
  	GetEntityNetClass(client, cls, sizeof(cls));		
  	offset = FindSendPropInfo(cls, prop, type, num_bits, local_offset);

  	
  	switch(type)
  	{
  		case PropField_Unsupported:
  		{
  			arraysize = GetEntPropArraySize(client, Prop_Send, prop);
  			
  			// How get PropFieldType from array ?
  			//offset = FindSendPropInfo(cls, prop, type, num_bits, local_offset);

  			for(int y = 0; y < arraysize; y++)
  			{
  				// Hacky hacky, "m_b*", "m_f*", "m_h*" etc. etc.
  				if(StrContains(prop, "m_f", true) == 0)
  				{
  					float m_fnewvalue = GetEntPropFloat(client, Prop_Send, prop, y);
  					...
  				}
  				else if(StrContains(prop, "m_i", true) == 0)
  				{
  					int newvalue = GetEntProp(client, Prop_Send, prop, _, y);
  					...
  				}
  			}
  		}
  	}
  	
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions