Open Gamepro5 opened 2 years ago
Managed to reproduce this while refunding with the custom Scout secondary / melee equipped on any MvM map.
I think I've seen this one before — what's happening is that at least one or more of the attributes being applied matches one of the upgrades available in MvM.
The upgrade system uses the same "runtime attribute" functionality that CWX (or rather, the underlying TF2Attributes) uses, and for some reason the game has a really slow path of iterating through each upgrade step even if it extends past the limit of what the game normally supports; in your config I think the critboost, clip size, and maybe max health bonuses match one of the game's existing upgrades.
For each upgrade step it respawns the player and revalidates their loadout, so as you can guess, having something like +99900% ammo capacity being upgraded in +50% increments is painfully slow. (I suspect something similar is what's causing players to get ejected from MvM during refunds with the recent net_chan_limit_msec
changes, just at a smaller scale.)
Edicts are only swept at one point in each game tick, and each respawn causes a new weapon to be generated, which is what leads up to the crash.
This isn't specific to CWX, but I suspect that if this doesn't affect CW3, it's because items are reapplied instead of persisted. Hard to tell for sure though.
The current workaround is to use an attribute name that doesn't match one of the game's upgrades (using an attribute with the same attribute class). If one doesn't exist, you can create one using a schema injecting-method such as Hidden Dev Attributes. The benefit of this method is that any upgrades recognized on the client for that item won't cause the game to crash (the UI will also try to draw an unbounded number of upgrade steps).
Leaving this open since this is a valid issue; however I can't guarantee that I'll have a fix for this. I'm hearing the "slow upgrade step" logic is going to be optimized since it does cause issues with the recent changes mentioned, so we may just see if it gets fixed that way.
I've also added a note for this in the getting started / item creation page.
Environment
Description
When clicking the "refund" button in mvm, the server crashes and reports "ED_Alloc no free edicts". This does not happen if this plugin is not installed.![Screenshot 2022-07-12 233955](https://user-images.githubusercontent.com/23440295/178667546-0689bd51-c54d-4d8e-845b-911ed5aa87b4.png)
Steps to replicate
Other information