Skip to content
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

Improve RemovePlayerWeapon native #917

Open
NexiusTailer opened this issue Apr 19, 2024 · 1 comment
Open

Improve RemovePlayerWeapon native #917

NexiusTailer opened this issue Apr 19, 2024 · 1 comment

Comments

@NexiusTailer
Copy link
Contributor

NexiusTailer commented Apr 19, 2024

Currently, RemovePlayerWeapon removes any weapon without setting armed (holding) weapon to the last reported by that player and it looks not so nice. Let's imagine 2 cases to see what happens and what can be done to improve this behaviour.

Case 1:
Player has deagle, shotgun and rifle, deagle is armed in his hands at the moment. Server tries to remove shotgun, RemovePlayerWeapon re-gives all weapons and the armed weapon automatically switches to rifle for this player.

Case 2:
Player has deagle, shotgun and rifle, deagle is armed in his hands at the moment. Server tries to remove deagle, RemovePlayerWeapon re-gives all weapons and the armed weapon still automatically switches to rifle for this player.

What can be done to easily correct case 1 behaviour is to just switch armed weapon to the last armed weapon which player had, if this weapon wasn't removed by the server. Case 2 is probably more complicated to decide which weapon this player should be switched to after removing exactly the one he was holding. This could be either switched to slot 0 (fist/brass knuckles), or the other variant is to switch it to the next weapon slot after the one that was removed.

@Y-Less
Copy link
Collaborator

Y-Less commented Apr 28, 2024

The first case I agree should be fixed. The second case you suggest switching to fists or the next slot. Of those I'd think fists made more sense - if you lose the weapon you're holding then you're by definition not holding anything. However, I don't think the current behaviour is really worth worrying about if it doesn't need to be, switching to the last slot is not really any different to switching to the next slot, it's still a fairly arbitrary choice.

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

No branches or pull requests

2 participants