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

Fix: Grenade weaponbox not deploying on unarmed player #847

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

dystopm
Copy link
Contributor

@dystopm dystopm commented Jul 13, 2023

How to reproduce:

  • Test environment cvars:
    • mp_buytime -1
    • mp_startmoney 10000
    • mp_forcerespawn 1
    • mp_ct_give_default_knife 0
    • mp_t_give_default_knife 0
    • mp_nadedrops 1
  • Join CT, buy hegrenade from buymenu and then change team to T
  • You'll drop your hegrenade cause of death, and respawn in a few seconds
  • Having no guns (ensure you have none), you'll pickup that hegrenade and see you are not deploying it until you force it (pressing 4, or typing weapon_hegrenade in console) - may lead in a HUD bug in some cases

This commit fixes two issues:

  • Grenade weaponbox not deploying on unarmed player after being picked up from ground.
  • HEGrenade not being deployed when picked up from ground if you are holding a Flashbang, considering HEGrenade has more weight than Flashbang.

This issue is related to weaponbox and not armoury_entity

TODO: Weaponbox gives ammo AFTER weapon is linked to player, CanDeploy depends on ammo in exhaustible weapons, we can consider this proposal as a final solution to that; or refactor the whole weaponbox behaviour.

Related to #479 but applied in a better fashion way, with explanation

@s1lentq s1lentq merged commit 1aae57f into s1lentq:master Sep 5, 2023
4 checks passed
@dystopm dystopm deleted the weaponbox-grenade-fix branch October 11, 2023 15:10
@Vaqtincha Vaqtincha mentioned this pull request Jan 12, 2024
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