File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -23,21 +23,23 @@ void StartPacifier(char const *pPrefix) {
2323}
2424
2525void UpdatePacifier (float flPercent) {
26- int iCur = (int )(flPercent * 40 .0f );
27- iCur = std::clamp (iCur, g_LastPacifierDrawn, 40 );
26+ constexpr int forty = 40 ;
2827
29- if (iCur != g_LastPacifierDrawn && !g_bPacifierSuppressed) {
30- for (int i = g_LastPacifierDrawn + 1 ; i <= iCur; i++) {
31- if (!(i % 4 )) {
32- Msg (" %d" , i / 4 );
28+ const int it = std::clamp (static_cast <int >(flPercent * forty),
29+ g_LastPacifierDrawn, forty);
30+
31+ if (it != g_LastPacifierDrawn && !g_bPacifierSuppressed) {
32+ for (int i = g_LastPacifierDrawn + 1 ; i <= it; i++) {
33+ const auto dv = div (i, 4 );
34+
35+ if (dv.rem == 0 ) {
36+ Msg (" %d" , dv.quot );
3337 } else {
34- if (i != 40 ) {
35- Msg (" ." );
36- }
38+ if (i != forty) Msg (" ." );
3739 }
3840 }
3941
40- g_LastPacifierDrawn = iCur ;
42+ g_LastPacifierDrawn = it ;
4143 }
4244}
4345
You can’t perform that action at this time.
0 commit comments