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

New Cvar: mp_drop_grenade_enable #782

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

JulioBarker
Copy link
Contributor

Allow players to drop grenades from their inventory

@StevenKal
Copy link
Contributor

StevenKal commented Oct 14, 2022

I might recommend to put a CVar via flags (or, via short names at the suite like for the CVar "mp_t_default_grenades") in order to control the manual drop "per grenade", then put the CVar code inside each function "*::CanDrop".
Like I did for a module here, so, more customizable.

@Vaqtincha
Copy link
Contributor

regame is slowly turning into a circus

@SergeyShorokhov SergeyShorokhov changed the title New Cvar: mp_drop_grenade_enable New Cvar: mp_drop_grenade_enable Nov 24, 2022
Copy link
Member

@SergeyShorokhov SergeyShorokhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found bug

Desc: It is enough to press G after throwing this grenade, but before deploy new weapon. It will drop fake nade

https://www.youtube.com/watch?v=aE1eI4Yud1I

@SergeyShorokhov
Copy link
Member

@JulioBarker need changes

@Vaqtincha
Copy link
Contributor

then players will start spamming with grenades. and you will add another million cvars to control it.

IMHO it's better to do this with 3rd party plugins.

@Vaqtincha
Copy link
Contributor

What else will happen if I have 2 flash? Will drop everything. Although it should be one at a time, but this requires an additional code.

@rehlds rehlds deleted a comment from Vaqtincha Nov 30, 2022
Copy link
Member

@SergeyShorokhov SergeyShorokhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still buggy with 2 flashes

@dystopm
Copy link
Contributor

dystopm commented Jul 13, 2023

IMO, this should be a 3rd party plugin. Idea is good, but:

  1. Dropping grenade per grenade would spam world with entities (considering you can extend grenade carry limit), leading to (2)
  2. If you have ammo > 1, then you'll drop a single grenade weaponbox containing +2 ammo on it, which is aesthetically uncomfortable, leading to (3)
  3. Use a different model (ammo box maybe? something like models/w_argrenade.mdl) for grenade weaponboxes but only when ammo > 1, but that will turn this to an extra feature, and an extra model precaching, leading to go outside the limits of the purpose of this project.

@s1lentq s1lentq force-pushed the master branch 3 times, most recently from a363cba to 79cfd71 Compare July 14, 2024 19:18
Copy link
Member

@SergeyShorokhov SergeyShorokhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +7931 to +7934
if (!pWeapon->CanDrop()
#ifdef REGAMEDLL_ADD
|| (!drop_grenade_enable.value && IsGrenadeWeapon(pWeapon->m_iId)) || (IsGrenadeWeapon(pWeapon->m_iId) && m_rgAmmo[pWeapon->PrimaryAmmoIndex()] <= 0)
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check how mp_nadedrops works and redo the code to take into account the weaponbox requirements and player checks that are already there.

@Vaqtincha

This comment has been minimized.

@StevenKal

This comment has been minimized.

@Vaqtincha

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants