I'm having an issue with TF2Items where GetNumAttributes is returning values way above the bounds of 0 and 15, which is preventing me from iterating through all of the attributes.
Is this me just screwing up my code like normal or am I hitting some other real problem?
Here's the code I'm using:
Code:
public Action:TF2Items_OnGiveNamedItem(client, String:classname[], iItemDefinitionIndex, &Handle:hItem)
{
hItem = TF2Items_CreateItem(PRESERVE_ATTRIBUTES|OVERRIDE_ATTRIBUTES);
new iItemIndex = TF2Items_GetItemIndex(hItem);
new iNumAttributes = TF2Items_GetNumAttributes(hItem);
LogMessage("Index: %i; Num attributes: %i", iItemIndex, iNumAttributes);
// code that changes the attributes of items...
return Plugin_Changed;
}
When this code is run, I get lines like these in my logs (mainly to debug the issues with this plugin not working):
Quote:
L 05/07/2013 - 19:32:14: [tf2xtreme.smx] Index: -2147483098; Num attributes: 131
L 05/07/2013 - 19:32:16: [tf2xtreme.smx] Index: 246; Num attributes: 135
L 05/07/2013 - 19:32:16: [tf2xtreme.smx] Index: 259; Num attributes: 101
L 05/07/2013 - 19:32:16: [tf2xtreme.smx] Index: 259; Num attributes: 105
L 05/07/2013 - 19:32:29: [tf2xtreme.smx] Index: 4194304; Num attributes: 0
L 05/07/2013 - 19:32:36: [tf2xtreme.smx] Index: 4; Num attributes: 0
L 05/07/2013 - 19:32:36: [tf2xtreme.smx] Index: 2147483647; Num attributes: 248
L 05/07/2013 - 19:32:48: [tf2xtreme.smx] Index: -1; Num attributes: 255
L 05/07/2013 - 19:32:48: [tf2xtreme.smx] Index: 8192; Num attributes: 16
L 05/07/2013 - 19:33:00: [tf2xtreme.smx] Index: 819180; Num attributes: 254
L 05/07/2013 - 19:33:09: [tf2xtreme.smx] Index: 16777216; Num attributes: 0
L 05/07/2013 - 19:33:09: [tf2xtreme.smx] Index: 536870916; Num attributes: 0
L 05/07/2013 - 19:33:34: [tf2xtreme.smx] Index: -1714789532; Num attributes: 9
L 05/07/2013 - 19:33:34: [tf2xtreme.smx] Index: 1228963968; Num attributes: 0
L 05/07/2013 - 19:33:34: [tf2xtreme.smx] Index: 3016; Num attributes: 0
L 05/07/2013 - 19:33:34: [tf2xtreme.smx] Index: 0; Num attributes: 0
L 05/07/2013 - 19:33:45: [tf2xtreme.smx] Index: 536870912; Num attributes: 0
L 05/07/2013 - 19:33:55: [tf2xtreme.smx] Index: -1630591512; Num attributes: 238
|