Skip to content

Commit

Permalink
Updated docs, errors for Get*Attribs
Browse files Browse the repository at this point in the history
  • Loading branch information
FlaminSarge committed Jul 3, 2015
1 parent 57badeb commit 2151210
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tf2attributes.inc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ native int TF2Attrib_ListDefIndices(int iEntity, int[] iDefIndices);
* @param flAttribValues Array (max size 16) of attribute values found on the item definition, corresponding to the indices.
*
* @return The number of attributes found on the item definition's static attribute list, or -1 if no schema or item definition found.
* @error Gamedata for this function failed to load.
*/
native int TF2Attrib_GetStaticAttribs(int iItemDefIndex, int[] iAttribIndices, float[] flAttribValues);

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

Expand Down
11 changes: 6 additions & 5 deletions tf2attributes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,7 @@ stock GetSOCAttribs(iEntity, iAttribIndices[], iAttribValues[])
return -1;
}
pEconItemView += Address:iCEIVOffset;
if (hSDKGetSOCData == INVALID_HANDLE)
{
return ThrowNativeError(SP_ERROR_NATIVE, "TF2Attrib_GetSOCAttribs: Could not find call to CEconItemView::GetSOCData");
}

new Address:pEconItem = SDKCall(hSDKGetSOCData, pEconItemView);
if (!IsValidAddress(pEconItem))
{
Expand Down Expand Up @@ -353,6 +350,10 @@ public Native_GetSOCAttribs(Handle:plugin, numParams)
{
return ThrowNativeError(SP_ERROR_NATIVE, "TF2Attrib_GetSOCAttribs: Invalid entity index %d passed", iEntity);
}
if (hSDKGetSOCData == INVALID_HANDLE)
{
return ThrowNativeError(SP_ERROR_NATIVE, "TF2Attrib_GetSOCAttribs: Could not find call to CEconItemView::GetSOCData");
}
//maybe move some address stuff to here from the stock, but for now it's okay
new iAttribIndices[16], iAttribValues[16];
new iCount = GetSOCAttribs(iEntity, iAttribIndices, iAttribValues);
Expand Down Expand Up @@ -821,7 +822,7 @@ struct CEconItemAttributeDefinition
BYTE blank,
DWORD apply_tag_to_item_definition, //52
DWORD unknown
};*/
/*class CEconItemAttribute
{
Expand Down

0 comments on commit 2151210

Please sign in to comment.