Skip to content

Commit

Permalink
Fix reading garbage in high-bits on name / attrdef mapping
Browse files Browse the repository at this point in the history
Apparently it's possible that the high bits aren't zeroed out in memory.
Not sure why; it seems quite rare.

Regardless, attribute definition indices are 16-bit tops so this shouldn't be a problem.
  • Loading branch information
nosoop committed Nov 2, 2020
1 parent e1fcc49 commit a728679
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripting/tf_econ_data.sp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <stocksoup/handles>
#include <stocksoup/memory>

#define PLUGIN_VERSION "0.17.0"
#define PLUGIN_VERSION "0.17.1"
public Plugin myinfo = {
name = "[TF2] Econ Data",
author = "nosoop",
Expand Down Expand Up @@ -408,7 +408,7 @@ public int Native_TranslateAttributeNameToDefinitionIndex(Handle hPlugin, int nP
if (pAttribute) {
Address pOffs =
pAttribute + offs_CEconItemAttributeDefinition_iAttributeDefinitionIndex;
return LoadFromAddress(pOffs, NumberType_Int32);
return LoadFromAddress(pOffs, NumberType_Int16);
}
return -1;
}
Expand Down

0 comments on commit a728679

Please sign in to comment.