B3none / csgo-retakes-instadefuse

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

Defuse time bug #4

Closed Ejz85 closed 5 years ago

Ejz85 commented 5 years ago

I think there might be a bug in the defuse plugin 4.5 seconds left to defuse and CT wins. It should take 5 or 10 seconds to defuse right? 4b85ee0e1012b1de258ae36be5c9dbdc-png

B3none commented 5 years ago

That's definitely a bug, will look into this now.

B3none commented 5 years ago

Looks like this was caused because the calculation I do to work out time left as well as the defusal time left are different.

float c4TimeLeft = GetConVarFloat(FindConVar("mp_c4timer")) - (GetGameTime() - g_c4PlantTime);

if(GetConVarInt(hEndIfTooLate) == 1 && GetEntPropFloat(c4, Prop_Send, "m_flC4Blow") < GetEntPropFloat(c4, Prop_Send, "m_flDefuseCountDown")) { ... }
B3none commented 5 years ago

Fixed in https://github.com/b3none/retakes-instadefuse/commit/fd905a6d9b420c149881cef8ce1cfedeb878342c