Add CVar "mp_plant_c4_anywhere_delay" + API member. #1
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.
Related to rehlds#683.
Add CVar "mp_plant_c4_anywhere_delay" + API member CCSPlayer's "m_flPlantC4AnywhereDelay" to allow per-client setting.
I made work the CVar to support a delay (or none when set to "-1") from the round start, because this is a bit abused to have that feature active from beginning! Like teams spawns then 5 seconds later "The bomb has been planted!".
Then I have also added a message informing the player who wants to plant outside from a bomb site that "he has to wait * second(s)", but the problem with that is there is no localization string (#*) on the client (so no game translations), so this is discutable, despite I think this worth to inform him about the feature.
So maybe we can discuss about it if you devs are against or not, or, what the overall player base is thinking.
About API member addition:
The new member CCSPlayer's "m_flPlantC4AnywhereDelay" has "2.0" as defaut "unconsidered value", this is in order to allow per-client support of "restriction" (if set to "0") instead of redirecting in such case to the CVar. The only workaround to support this kind of feature is to set the CVar to 0 & set per-client settings via the member, so it is easier the way I did.
Also, I have updated ReGameDLL_CS's API minor because any addition to API even in the class "CCSEntity" worth to increment this (to know the new member requires a specific API version of ReGameDLL_CS, despite the "commits number" could be used as workaround for such "tiny" thing).
Extra notes:
Also added "EXPORT" label to 2 functions of the class "CHalfLifeMultiplay" in order to allow easy retrieval of the function address via symbol under Windows (like under Linux).
I could also make them "virtual" but I prefered to do not in order to avoid breaking already existing virtual IDs listing ("HasRoundTimeExpired" + "IsBombPlanted" being at the suite...) & AMXX's ReAPI module using full CSSDK (and not only the "pure public ReAPI interfaces" like my own AMX's ReAPI module).
The kind of per-client API member could be added for a lot of other features (mp_buytime, mp_buy_anywhere, mp_forcerespawn, mp_freeforall, etc.), I basically have plans to do it because this allows customization per-client & so interesting, like if you want to enable FFA for only 1 client (like I have this on my public classic server, I can TK my teammates (the dumb ones!) this counts as frag! Hehehehehe!).
PS: I did not see someone already pushed similar PR here like 1 hour before, and I had mine ready from yesterday, but mine is more "advanced" and does not deal with signals (not sure if it is the best but at least client carrying the C4 can know if he is on a bomb site... as indication, and this is also that Maxi605 said so I guess no red blink icon under CS:GO right? I can not check I do not have the game). Feel free to choose which one you want! Or, extend the other one with the features of mine (as the API member).