B3none / csgo-retakes-instadefuse

Allows a CT to instantly defuse the bomb when nothing can prevent defusal.
70 stars 15 forks source link

Add Condition checking for round when other player try to defuse without kit when Kit with other player is available #22

Closed TandelK closed 2 years ago

TandelK commented 4 years ago

This scenario happens mostly in Pistol Rounds. If the team has 4 CT players and 1 has Kit and 3 T gets killed and time remaining is just 8 seconds but the guy without defuse kit try to defuse and the game gets over instead he can ask his Friend with Kit to defuse the bomb which is a valid point. Add a conditional checking saying that Defuse Kit is available on any player as output or keep the game going on normal defuse.

B3none commented 4 years ago

I can add a check to loop the team and see if another player has a kit and not instantly end the round. That's a good shout! I'll implement that in the next release.

crashzk commented 2 years ago

+1

enghausen commented 2 years ago

I gave it a try on my fork. Nothing fancy just another if-statement with some for-loops right after we determine if the defusing client have time to defuse (with or without a kit).

We could also integrate it into the first if-statement, but I liked to keep it separated to avoid bugs and change the code I know works pretty well.

https://github.com/enghausen/retakes-instadefuse/commit/300f5f907c5d71734fcccbc3010d0cd11505c417#diff-1be0f9b92c8ff7fa27b6b737e2b0d9de69b5a63d4c13374dac5a8ae8f5d51880

I also updated all the *.phrases.txt files (I know Danish and English, rest is Google Translate) and bumped up the version number to 1.4.1 to avoid mistakes in my testing.

You can find a compiled version on my fork as well if you would like to test it or just grab the if-statement and use it as you like.

Feedback is always welcome, I did not put many thoughts into edge scenarios where this statement is not enough.

B3none commented 2 years ago

This change looks good @enghausen, just a couple of updates to the PR. Can you submit one and I'll post them. Just some small changes then this can go in and get released.

enghausen commented 2 years ago

@b3none #38 - Go crazy 😉

enghausen commented 2 years ago

https://github.com/b3none/retakes-instadefuse/releases/tag/1.5.0

You can close this :-)