Skip to content

Fix: Grenade weaponbox not deploying on unarmed player#847

Merged
s1lentq merged 3 commits intorehlds:masterfrom
dystopm:weaponbox-grenade-fix
Sep 5, 2023
Merged

Fix: Grenade weaponbox not deploying on unarmed player#847
s1lentq merged 3 commits intorehlds:masterfrom
dystopm:weaponbox-grenade-fix

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 rehlds:master Sep 5, 2023
@dystopm dystopm deleted the weaponbox-grenade-fix branch October 11, 2023 15:10
@Vaqtincha Vaqtincha mentioned this pull request Jan 12, 2024
yohimik pushed a commit to yohimik/ReGameDLL_CS that referenced this pull request Jun 5, 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