-
-
Notifications
You must be signed in to change notification settings - Fork 459
cstrike: Fix wrong timeleft calculation #1072
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
cstrike: Fix wrong timeleft calculation #1072
Conversation
|
[8:18 PM] Moltard: "cstrike: Fix wrong timeleft calculation" |
KyleSanderson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super minor - the problem case has definitely happened to us before.
extensions/cstrike/timeleft.cpp
Outdated
|
|
||
| float flGameStartTime = gpGlobals->curtime; | ||
| sm_sendprop_info_t info; | ||
| if (gamehelpers->FindSendPropInfo("CCSGameRulesProxy", "m_flGameStartTime", &info)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you nest this under gamerules? Doesn't make sense to do the lookup if the variable is only used if gamerules is valid. Not that this is a hot path - just a nit.
KyleSanderson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome - thx bud.
* Fix wrong timeleft calculation * reorder function calls
* Fix wrong timeleft calculation * reorder function calls
* Fix wrong timeleft calculation * reorder function calls
(I actually forgot what exactly the buggy behavior was)