Skip to content

[HL2MP] Fix bots rapidly switching to and from gravity gun #1372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Blixibon
Copy link

When a HL2MP bot approaches a prop to pick up, it sometimes rapidly switches between its gravity gun and a different weapon. This is because CHL2MPBot::EquipRequiredWeapon() returns Weapon_Switch directly when using the weapon stack, which is false when the weapon is already out. This causes the required weapon to only be enforced when it is not equipped, hence why it switches back so quickly when another weapon takes its place. This pull request calls Weapon_Switch without using its value and always returns true like with the weapon restriction cases.

The prop behavior is the only component that uses the weapon stack, but any other behavior using it would presumably experience a similar issue.

Bitl added a commit to BitlDevelopmentStudios/source-sdk-2013-bds-base that referenced this pull request Jun 26, 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.

1 participant