Rename get_ent_data_size/info/basetype to be more generic
This commit is contained in:
parent
68f99bc2d5
commit
02c1b20ed7
@ -739,18 +739,22 @@ static cell AMX_NATIVE_CALL set_gamerules_string(AMX *amx, cell *params)
|
||||
|
||||
|
||||
|
||||
// native get_ent_data_size(const class[], const member[]);
|
||||
static cell AMX_NATIVE_CALL get_ent_data_size(AMX *amx, cell *params)
|
||||
// native get_member_size(const class[], const member[]);
|
||||
static cell AMX_NATIVE_CALL get_member_size(AMX *amx, cell *params)
|
||||
{
|
||||
CHECK_GAMERULES();
|
||||
|
||||
TypeDescription data;
|
||||
GET_TYPE_DESCRIPTION(0, data, BaseFieldType::None, ALL);
|
||||
GET_TYPE_DESCRIPTION(1, data, BaseFieldType::None, ALL);
|
||||
|
||||
return data.fieldSize;
|
||||
}
|
||||
|
||||
// native find_ent_data_info(const class[], const member[], &FieldType:type = FIELD_NONE, &arraysize = 0, &bool:unsigned = false);
|
||||
static cell AMX_NATIVE_CALL find_ent_data_info(AMX *amx, cell *params)
|
||||
// native find_member_info(const class[], const member[], &FieldType:type = FIELD_NONE, &arraysize = 0, &bool:unsigned = false);
|
||||
static cell AMX_NATIVE_CALL find_member_info(AMX *amx, cell *params)
|
||||
{
|
||||
CHECK_GAMERULES();
|
||||
|
||||
TypeDescription data;
|
||||
GET_TYPE_DESCRIPTION(1, data, BaseFieldType::None, ALL);
|
||||
|
||||
@ -786,8 +790,8 @@ AMX_NATIVE_INFO pdata_gc_natives[] =
|
||||
{ "get_gamerules_string", get_gamerules_string },
|
||||
{ "set_gamerules_string", set_gamerules_string },
|
||||
|
||||
{ "get_ent_data_size" , get_ent_data_size },
|
||||
{ "find_ent_data_info" , find_ent_data_info },
|
||||
{ "get_member_size" , get_member_size },
|
||||
{ "find_member_info" , find_member_info },
|
||||
|
||||
{ nullptr , nullptr }
|
||||
};
|
||||
|
@ -995,7 +995,7 @@ native set_gamerules_string(const class[], const member[], const value[], elemen
|
||||
* @error If either class or member is empty, no offset is found or an invalid
|
||||
* offset is retrieved, an error will be thrown.
|
||||
*/
|
||||
native get_ent_data_size(const class[], const member[]);
|
||||
native get_member_size(const class[], const member[]);
|
||||
|
||||
/**
|
||||
* Finds an offset based off a class and member name.
|
||||
@ -1008,9 +1008,9 @@ native get_ent_data_size(const class[], const member[]);
|
||||
*
|
||||
* @return Class member offset
|
||||
* @error If either class or member is empty, no offset is found or an invalid
|
||||
* offset is retrieved, an error will be thrown.
|
||||
* offset is retrieved, an error will be thrown.
|
||||
*/
|
||||
native find_ent_data_info(const class[], const member[], &FieldType:type = FIELD_NONE, &arraysize = 0, &bool:unsigned = false);
|
||||
native find_member_info(const class[], const member[], &FieldType:type = FIELD_NONE, &arraysize = 0, &bool:unsigned = false);
|
||||
|
||||
/**
|
||||
* Returns the data field base type based off a specific field type.
|
||||
@ -1025,9 +1025,9 @@ native find_ent_data_info(const class[], const member[], &FieldType:type = FIELD
|
||||
*
|
||||
* @return Base field type (BASEFIELD_* constants)
|
||||
*/
|
||||
stock BaseFieldType:get_ent_data_basetype(FieldType:type, type_name[] = "", maxlen = 0)
|
||||
stock BaseFieldType:get_field_basetype(FieldType:type, type_name[] = "", maxlen = 0)
|
||||
{
|
||||
static baseFieldTypeNames[BaseFieldType][] =
|
||||
static const baseFieldTypeNames[BaseFieldType][] =
|
||||
{
|
||||
"none",
|
||||
"integer",
|
||||
|
Loading…
Reference in New Issue
Block a user