Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Better accessors, pt. 1

Compare
Choose a tag to compare
@nosoop nosoop released this 06 Oct 06:37

Couple of new convenience functions to use. Huzzah.

Added

  • Natives TF2Attrib_HookValueFloat and TF2Attrib_HookValueInt, which transforms an input value based on attributes matching the specified attribute class on a given entity (player or weapon).
    • If you're familiar with the third-party TF2 projects, this implements the CALL_ATTRIB_HOOK_FLOAT and CALL_ATTRIB_HOOK_INT macros, or CAttributeManager::AttribHookValue<> functions.
    • If you're not familiar with it, this means you don't have to collect all the attributes from runtime or item server that share the same functionality (e.g., "damage penalty", "damage bonus", "CARD: damage bonus", etc.) and determine how they stack — the game handles all of that for you.

Changed

  • Error messages have been reworded to match SourceMod's style.
  • Native functions now use const char[] instead of unconsted char[]. This allows the use of passed-in const char[] arguments from functions up the call chain.