FlaminSarge / tf2attributes

TF2Attributes SourceMod plugin
48 stars 41 forks source link

Add a few natives for working with CEconItemView objects. #57

Open NotnHeavy opened 2 months ago

NotnHeavy commented 2 months ago

This probably seems like a strange suggestion but should this become mainstream, it should allow me to incorporate some changes in a weapon manager plugin that I am currently in the midst of working on without having to introduce my own natives.

NotnHeavy commented 2 months ago

The reason I came up with these natives more specifically is so that I can work on patching specific attributes of a specific CEconItemView object before TF2 actually assigns the weapon to a player in CTFPlayer::ManageRegularWeapons(). I don't really want to rewrite functions like CTFPlayer::ItemIsAllowed() completely hence this method.

FlaminSarge commented 2 months ago

The reason I came up with these natives more specifically is so that I can work on patching specific attributes of a specific CEconItemView object before TF2 actually assigns the weapon to a player in CTFPlayer::ManageRegularWeapons(). I don't really want to rewrite functions like CTFPlayer::ItemIsAllowed() completely hence this method.

That makes sense, but I thought TF2Items provided a forward to perform that kind of modification already?

nosoop commented 2 months ago

That makes sense, but I thought TF2Items provided a forward to perform that kind of modification already?

Upstream TF2Items doesn't do so in a way that works with the weapon pickup mechanic introduced in the Gun Mettle Update.

I'll defer to Sarge on whether or not to pull this in, but I feel like the root problem could be better solved some other way.