| 582 | |
| 583 | |
| 584 | bool showhudtimer(int maxsecs, int startmillis, const char *msg, bool flash) |
| 585 | { |
| 586 | static string str = ""; |
| 587 | static int tickstart = 0, curticks = -1, maxticks = -1; |
| 588 | int nextticks = (lastmillis - startmillis) / 200; |
| 589 | if(tickstart!=startmillis || maxticks != 5*maxsecs) |
| 590 | { |
| 591 | tickstart = startmillis; |
| 592 | maxticks = 5*maxsecs; |
| 593 | curticks = -1; |
| 594 | copystring(str, "\f3"); |
| 595 | } |
| 596 | if(curticks >= maxticks) return false; |
| 597 | nextticks = min(nextticks, maxticks); |
| 598 | while(curticks < nextticks) |
| 599 | { |
| 600 | if(++curticks%5) concatstring(str, "."); |
| 601 | else |
| 602 | { |
| 603 | defformatstring(sec)("%d", maxsecs - (curticks/5)); |
| 604 | concatstring(str, sec); |
| 605 | } |
| 606 | } |
| 607 | if(nextticks < maxticks) hudeditf(HUDMSG_TIMER|HUDMSG_OVERWRITE, "%s", flash ? str : str+2); |
| 608 | else hudeditf(HUDMSG_TIMER, "%s", msg); |
| 609 | return true; |
| 610 | } |
| 611 | |
| 612 | int lastspawnattempt = 0; |
| 613 |
no test coverage detected