Skip to content

Conversation

@BotoX
Copy link
Contributor

@BotoX BotoX commented Sep 2, 2019

(I actually forgot what exactly the buggy behavior was)

@BotoX
Copy link
Contributor Author

BotoX commented Sep 2, 2019

[8:18 PM] Moltard: "cstrike: Fix wrong timeleft calculation"
wasnt it that the timeleft from the scoreboard and the sourcemod timeleft were different, and the vote happened on the sourcemod timeleft. but final round happened on the scoreboard timeleft
[8:19 PM] Moltard: the difference between the 2 happened after doing a mp_restartgame 1 in maps
[8:24 PM] zaCade: ye
[8:24 PM] zaCade: that was it
[8:25 PM] zaCade: The time in sourcemod wouldnt reset
[8:25 PM] zaCade: while the scoreboard ect would
[8:25 PM] Moltard: and if the difference was too big, the map could end with no nextmap and it was a random nextmap picked
[8:25 PM] zaCade: yep
[8:25 PM] Moltard: nah I think ti's the opposite
[8:25 PM] Moltard: the scoreboard time didnt reset
[8:25 PM] Moltard: but sourcemod reset
[8:25 PM] zaCade: no it does
[8:25 PM] Moltard: on mg it happened so many time
[8:26 PM] Moltard: (or on mg, that was different)
[8:26 PM] zaCade: That was something else

Copy link
Member

@KyleSanderson KyleSanderson left a 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.


float flGameStartTime = gpGlobals->curtime;
sm_sendprop_info_t info;
if (gamehelpers->FindSendPropInfo("CCSGameRulesProxy", "m_flGameStartTime", &info))
Copy link
Member

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.

Copy link
Member

@KyleSanderson KyleSanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - thx bud.

@KyleSanderson KyleSanderson merged commit d93f698 into alliedmodders:master Sep 2, 2019
BotoX added a commit to BotoX/sourcemod that referenced this pull request Sep 10, 2019
* Fix wrong timeleft calculation

* reorder function calls
BotoX added a commit to BotoX/sourcemod that referenced this pull request Sep 21, 2019
* Fix wrong timeleft calculation

* reorder function calls
Headline pushed a commit that referenced this pull request Nov 1, 2019
* Fix wrong timeleft calculation

* reorder function calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants