Skip to content

[TF2] Fix Half-Zatoichi being invisible when held by disguised Spy - #2005

Open
Piogre wants to merge 3 commits into
ValveSoftware:masterfrom
Piogre:disguise-katana
Open

[TF2] Fix Half-Zatoichi being invisible when held by disguised Spy#2005
Piogre wants to merge 3 commits into
ValveSoftware:masterfrom
Piogre:disguise-katana

Conversation

@Piogre

@Piogre Piogre commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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.

sollybefore sollyafter demobefore demoafter

…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.
@Ashe-tf

Ashe-tf commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Disguised Demo is holding the katana wrong

@Chickenman456

Copy link
Copy Markdown

Disguised Demo is holding the katana wrong

That's just how he uses it in-game I'm pretty sure

@Piogre

Piogre commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

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

@Chickenman456

Copy link
Copy Markdown

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

Ah I see. I had no idea that issue was exclusive to the loadout screens!

@Piogre
Piogre marked this pull request as draft August 20, 2026 00:13
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
@Piogre
Piogre marked this pull request as ready for review August 20, 2026 00:28
@Piogre

Piogre commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Disguised Demo is holding the katana wrong

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants