[TF2] Fix botkiller related disguise issue#1939
Conversation
|
As discussed this leaks and causes the issue in ValveSoftware/Source-1-Games#8021 I would also be worried that you are also moving these lines to after the drop, which might lead to a leak. The drop happens here. My suggestion is to leave the cap in place and try to move these lines to right before the drop. That likely fixes the issue. RemovingExtraWearbles entirely in this function will lead to a regression in the battalions backup + quickfix + vaccinator cases, so that cant be done. You have to specifically target botkillers with hard coding. This is why i went with the cap solution, its ugly, but it prevents the leak and preserves the banner + medigun cases. In any case you must test battalions backup + quickfix + vaccinator to avoid regression. |
|
Just reread, and you are actually before the drop but i still think this should go in CTFWeaponBase::Drop before line 1137. |
Description
Botkiller disguise has two issues. The spy could clone up to 5 botkiller models when switching to botkiller weapon, and the botkiller model staying after the spy switches to other disguise weapon.
This PR fixes this by looking up items that have item definition "extra_wearable_vm" which is currently exclusively used by botkiller weapons, and then remove the botkiller model.
Before:
ezgif-10a3779788633ade.mp4
After:
ezgif-1b85fc2d15b1b528.mp4
Edit:
Currently this PR will cause edict leak, I will evaluate a better solution later.