Skip to content

The eco(n)system grows

Compare
Choose a tag to compare
@nosoop nosoop released this 13 Feb 14:15
· 22 commits to master since this release

This is a minor update.

If coming from an older version of the plugin, you will need to update tf2.econ_data.txt.

Fixed

  • TF2Econ_GetItemDefinitionAddress correctly returning null instead of the address of the special "default" item definition on invalid item definitions. If you specifically want that definition, call it with TF_ITEMDEF_DEFAULT. (#5)
    • This also fixes TF2Econ_IsValidItemDefinition always returning true.

Changed

  • Natives TF2Econ_GetItemDefinitionString and TF2Econ_GetAttributeDefinitionString now return bool instead of void; the return value is true if the output buffer is not as empty string (if you specify a non-empty default value, this should always be true). This allows authors to inline ifs instead of having to do a buffer[0] check each time.
  • Dropped dependency of tf2_stocks from the plugin, and in turn, the TF2 extension. We never really needed those anyways. The plugin still requires SDKTools for calling game functions. However, the include file still pulls in tf2_stocks, as TF2Econ_GetItemSlot does require a TFClassType value.
  • TF2Econ_GetItemStaticAttributes was modified to require new gamedata sizeof(static_attrib_t), which is used internally when the function iterates over the attribute list in memory. This is not actually necessary for TF2, but combined with dropping the dependency on the TF2 extension, this allows a semi-unified codebase for other games to build off of.
  • Many parameter names have been changed from defindex to either itemdef or attrdef, to better contextualize what definition indices are associated with the native. This is a breaking compile-time change if you were using named parameters for those.