Batfoxkid / Freak-Fortress-2-Rewrite

The gamemode that's now also a standalone boss maker.
https://forums.alliedmods.net/forumdisplay.php?f=154
GNU General Public License v3.0
17 stars 8 forks source link

Proper way to strip attributes #8

Closed tsuza closed 2 years ago

tsuza commented 2 years ago

The only way to maintain attributes such as min_viewmodel_offset is to not remove them in the first place. We have to manually nullify all the static attributes the weapon has.

I've tested it and it works fine. Though, I have no way to properly test all the edge cases ( if they exist in the first place ).

tsuza commented 2 years ago

I've noticed that I'm straight up utilizing TF2Econ_GetItemStaticAttributes rather than making a separate function to take into account if EconData is loaded ( TF2ED_, like TF2ED_GetAttributeDefinitionString ). If it's an issue let me know and I'll add it in.

Batfoxkid commented 2 years ago

Econ Data is optional however TF2Attributes has a similar function (TF2Attrib_GetStaticAttribs ) and is a requirement already

tsuza commented 2 years ago

I've already mentioned it on Discord but I'll formally do it here as well: I didn't use TF2Attrib_GetStaticAttribs because it didn't return anything.

HOWEVER, I've tested it today again while making TF2Econ_GetItemStaticAttributes into an optional function ( econdata.sp ) and TF2Attrib_GetStaticAttribs seems to be working just fine now. Weird. I spent the entire night yesterday trying to figure out why it wasn't returning anything ( apart from like two useless attributes ), even outside of FF2.