Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CTFPlayer::GetLoadoutItem and CTFPlayerInventory::GetItemInLoadout #6

Open
doclic opened this issue Aug 13, 2022 · 3 comments
Labels
enhancement New feature or request not open season Further discussion is needed; don't write code for this yet

Comments

@doclic
Copy link

doclic commented Aug 13, 2022

CTFPlayerInventory::GetItemInLoadout gets the player's equipped item in the specified class's specified loadout slot.
CTFPlayer::GetLoadoutItem calls CTFPlayerInventory::GetItemInLoadout but also checks to see if the item is banned in the competitive whitelist, in which case, the base/stock item is returned.
I think natives to use those 2 functions would be useful.

@nosoop
Copy link
Owner

nosoop commented Aug 14, 2022

I can't think of a really compelling use case for them since you'd still need to do something with the CEconItemView* you get, but regardless it's very much outside the scope of Econ Data.

It might be a little more fitting in TF2 Utils, so I'll transfer this issue there. If you're looking for gamedata to use yourself, CTFPlayer::GetLoadoutItem() is used in Custom Weapons X.

@nosoop nosoop transferred this issue from nosoop/SM-TFEconData Aug 14, 2022
@nosoop
Copy link
Owner

nosoop commented Aug 14, 2022

One functionality that could fit in Econ Data would be the competitive allowlist; that is actually set as an item definition property.

I wouldn't be against adding first-class support for that there aside from the potential maintenance burden, though TF2Econ_GetItemDefinitionAddress() is provided so users can access whatever properties they'd like without having to go through me.

@doclic
Copy link
Author

doclic commented Aug 14, 2022

Okay, I understand, thanks for the quick answer!

@nosoop nosoop added not open season Further discussion is needed; don't write code for this yet enhancement New feature or request labels Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request not open season Further discussion is needed; don't write code for this yet
Projects
None yet
Development

No branches or pull requests

2 participants