Add CVar "mp_plant_c4_delay" + API member.#6
Open
StevenKal wants to merge 15 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
o Added new CVar "mp_plant_c4_delay" to control the "waiting delay" before planting the C4 (works for both normal & plant anywhere modes).
o Renamed CCSPlayer's API member "m_bPlantC4Anywhere" into "m_iCanPlantC4Anywhere" & extend its behaviour by allowing a specific client to do not have the "plant C4 anywhere" active while the CVar "mp_plant_c4_anywhere" can be.
o Added new CCSPlayer's API member "m_flPlantC4Delay" which works the same way as above, and also for both normal & plant anywhere modes.
o Added related code to the feature including a new function in the gamerules with custom enum, a new custom signal for detecting delay change, then an information message to the client trying to plant when the delay is not over.
o Fixed C4 icon unblinked on situations where it should not (like if you receive one via "GiveNamedItemEx" and when you are on site, icon unblinked on the past).
o Fixed C4 planting capabilities gone once a player has planted the C4 and if he still have some C4 in BP ammo.
Note: This fix does not allow the game to handle properly "multiple C4 support", other parts in the code (like in "CBasePlayer::DropPlayerItem", CHLMP's "m_bBombDropped", etc.) might need a deeper rework for this, I might do that later, but this is more to handle extra plugins which can give more than 1 C4, not a standard game behaviour which is, only 1 C4!