[TF2] Fix Half-Zatoichi being invisible when held by disguised Spy - #2005
[TF2] Fix Half-Zatoichi being invisible when held by disguised Spy#2005Piogre wants to merge 3 commits into
Conversation
…weapons this only currently matters, afaik, for one weapon -- if a spy is disguised as a demo or soldier holding a half-zatoichi, this prevents it from asking for the spy model of the half-zatoichi (which doesn't exist since it's only usable by demo and soldier) and drawing a blank as a result.
|
Disguised Demo is holding the katana wrong |
That's just how he uses it in-game I'm pretty sure |
no, no it's not. in-game he holds it two-handed like the eyelander. I didn't catch it because there's a separate issue that causes him to hold it one-handed in the lower-left panel (along with loadout screen, see ValveSoftware/Source-1-Games#1971) -- I didn't catch it because it matched the lower-left panel so nothing seemed inconsistent technically a separate issue but it may be that both are fixable; I'll take a look edit: found the fix for this, will add |
Ah I see. I had no idea that issue was exclusive to the loadout screens! |
The katana uses an override method to set the player's animation activity to item1 if-and-only-if the player wielding it is the demoman. If the wielder is a disguised spy (and the weapon is a disguiseweapon), it needs to check the disguise target instead of the player's own class
added a fix for this, good catch ty |
the animation fix had a regression issue due to checking the disguise target's current class rather than the disguise class itself. This caused a demoman disguise with the katana to revert back to default animation if the disguise target changed classes, and caused a soldier disguise with the katana to a-pose if the disguise target changed to demoman. this commit fixes this issue and cleans up the code in the process
2e038d9 to
2568ade
Compare
Currently, if a Spy is disguised as a Soldier or Demoman with the Half-Zatoichi equipped, and has their disguise weapon set to the melee slot, the Half-Zatoichi model will not appear to enemy players, leaving the disguised Spy holding nothing (a major giveaway that they are a Spy).
This is because the Half-Zatoichi is (as far as I'm aware) the only weapon to make use of model_player_per_class in its item definition, and the code to fetch the world model for the weapon just calls for it based on the owner's class (which in this case is Spy, not Soldier or Demoman).
This PR fixes this issue, so that a disguised Spy holding the Half-Zatoichi as the disguise weapon will load the correct katana model for the disguise's class. It also forces the Demoman disguise to use the correct animation for the Half-Zatoichi.