Skip to content

Conversation

@nosoop
Copy link
Contributor

@nosoop nosoop commented Dec 2, 2025

Description

A conditional in its current form attempts to switch to a secondary item only if it can't be selected.
This change fixes the typo, properly enabling the fallback to the secondary item if a primary is unavailable.

Note that taking this change in as-is results in Spy spawning with the Revolver out instead of the Knife. Possible resolutions:

  • Spy-specific code that prioritizes a knife change ahead of this, falling back to primary / secondary on failure
  • Replace the entire default spawn selection code with SwitchToNextBestWeapon( NULL ); and increase the weight of the knife in scripts/tf_weapon_knife.ctx (side effects of using this in ManageRegularWeapons are not known to me, and there may be other cases where the Revolver is preferable over the Knife)

@nosoop nosoop changed the title Fix never falling back to secondary on initial spawn [TF2] Fix never falling back to secondary on initial spawn Dec 2, 2025
@JoriKos
Copy link
Contributor

JoriKos commented Dec 2, 2025

I think Spy spawning with his Revolver is not that big of a deal, and probably better since most Spy players could use the hint.

@nosoop
Copy link
Contributor Author

nosoop commented Dec 2, 2025

I think Spy spawning with his Revolver is not that big of a deal, and probably better since most Spy players could use the hint.

It's a notable change ("fix") in behavior, hence the callout. Whether or not the current behavior in this case is desired, I'll leave up to the maintainer(s). Open to amending the PR if they'd like.

@nosoop
Copy link
Contributor Author

nosoop commented Dec 2, 2025

On further investigation this bug also affects Demoman with a non-weapon primary slot item and weapon (non-shield) secondary.

@nosoop nosoop changed the title [TF2] Fix never falling back to secondary on initial spawn [TF2] Fix never falling back to secondary on spawn Dec 3, 2025
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.

2 participants