Skip to content

Commit 2151210

Browse files
committed
Updated docs, errors for Get*Attribs
1 parent 57badeb commit 2151210

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tf2attributes.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ native int TF2Attrib_ListDefIndices(int iEntity, int[] iDefIndices);
172172
* @param flAttribValues Array (max size 16) of attribute values found on the item definition, corresponding to the indices.
173173
*
174174
* @return The number of attributes found on the item definition's static attribute list, or -1 if no schema or item definition found.
175+
* @error Gamedata for this function failed to load.
175176
*/
176177
native int TF2Attrib_GetStaticAttribs(int iItemDefIndex, int[] iAttribIndices, float[] flAttribValues);
177178

@@ -183,7 +184,7 @@ native int TF2Attrib_GetStaticAttribs(int iItemDefIndex, int[] iAttribIndices, f
183184
* @param flAttribValues Array (max size 16) of attribute values found, corresponding to the indices.
184185
*
185186
* @return The number of attributes found on the item's SOC attribute list, or -1 if some error happened.
186-
* @error Invalid entity index passed.
187+
* @error Invalid entity index passed or gamedata for this function failed to load.
187188
*/
188189
native int TF2Attrib_GetSOCAttribs(int iEntity, int[] iAttribIndices, float[] flAttribValues);
189190

tf2attributes.sp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,7 @@ stock GetSOCAttribs(iEntity, iAttribIndices[], iAttribValues[])
314314
return -1;
315315
}
316316
pEconItemView += Address:iCEIVOffset;
317-
if (hSDKGetSOCData == INVALID_HANDLE)
318-
{
319-
return ThrowNativeError(SP_ERROR_NATIVE, "TF2Attrib_GetSOCAttribs: Could not find call to CEconItemView::GetSOCData");
320-
}
317+
321318
new Address:pEconItem = SDKCall(hSDKGetSOCData, pEconItemView);
322319
if (!IsValidAddress(pEconItem))
323320
{
@@ -353,6 +350,10 @@ public Native_GetSOCAttribs(Handle:plugin, numParams)
353350
{
354351
return ThrowNativeError(SP_ERROR_NATIVE, "TF2Attrib_GetSOCAttribs: Invalid entity index %d passed", iEntity);
355352
}
353+
if (hSDKGetSOCData == INVALID_HANDLE)
354+
{
355+
return ThrowNativeError(SP_ERROR_NATIVE, "TF2Attrib_GetSOCAttribs: Could not find call to CEconItemView::GetSOCData");
356+
}
356357
//maybe move some address stuff to here from the stock, but for now it's okay
357358
new iAttribIndices[16], iAttribValues[16];
358359
new iCount = GetSOCAttribs(iEntity, iAttribIndices, iAttribValues);
@@ -821,7 +822,7 @@ struct CEconItemAttributeDefinition
821822
BYTE blank,
822823
DWORD apply_tag_to_item_definition, //52
823824
DWORD unknown
824-
825+
825826
};*/
826827
/*class CEconItemAttribute
827828
{

0 commit comments

Comments
 (0)