nosoop / SM-TFCustomAttributeStarterPack

A collection of plugins to be used with the TF2 Custom Attribute framework.
MIT License
19 stars 10 forks source link

MvM Attributes "AlwaysCrit" applies Crit boost to all weapons if set on a weapon #58

Open SoulBlast35 opened 2 years ago

SoulBlast35 commented 2 years ago

Initial troubleshooting checklist

Describe the bug If the "MvM Attributes" attribute is used to apply a perma-critboost to a weapon, it will apply the boost to all weapons, but only the Primary weapon will receive the Critical glow.

To Reproduce Apply "MvM Attributes" "AlwaysCrit" to any custom weapon

Expected behavior Only that specific Weapon should be critboosted

Server environment (please complete the following information):

Additional context Im not sure if this is intentional or not. The Spy's Knife, will play the Backstab animation on every swing, but doesnt seem to actually crit at all (So we can probably class this as an actual bug rather than an oversight)

nosoop commented 2 years ago

Ah, I see what code handles this.

I don't remember if the person that requested this plugin specified if AlwaysCrit was supposed to only be active on a given item or applied across the board if any item had it; will review the conversation on it when I have the time.

That said, it does look like the condition being removed on switch is caused by the game, and that would be a bug in any case.

nosoop commented 2 years ago

Yeah, upon review I'm fairly sure mvm attributes is supposed to act as a passive property (the resulting flags is the combined result of the flags on all weapons).

The bug would be critical glows not rendering.

SoulBlast35 commented 2 years ago

I have sort of been able to partially fix this myself by changing the TFCond to "CritOnKill", however, it still affects all weapons.

nosoop commented 2 years ago

it still affects all weapons

That is intentional; the attribute affects the player whether or not the item with the attribute is active or not. addcond while active is likely the preferred attribute for the case when a condition should only be active when a weapon is out.

I've added a note to clarify this in the wiki entry.

SoulBlast35 commented 2 years ago

Right, gotcha. But a quick fix for the crit glow not rendering (And the Spy's Knife not working with AlwaysCrit) is to switch to the CritOnKill Condition, since currently, it's using the Phlog Rage condition, which only renders the crit glow on the Primary weapon.