| 661 | COMMANDF(resetsleeps, "", (void) { resetsleep(true); }); |
| 662 | |
| 663 | void updateworld(int curtime, int lastmillis) // main game update loop |
| 664 | { |
| 665 | // process command sleeps |
| 666 | sleepssemaphore->wait(); |
| 667 | loopv(sleeps) |
| 668 | { |
| 669 | if(lastmillis - sleeps[i].millis >= sleeps[i].wait) |
| 670 | { |
| 671 | char *cmd = sleeps[i].cmd; |
| 672 | sleeps[i].cmd = NULL; |
| 673 | sleeps.remove(i--); |
| 674 | sleepssemaphore->post(); |
| 675 | execute(cmd); |
| 676 | delete[] cmd; |
| 677 | sleepssemaphore->wait(); |
| 678 | } |
| 679 | } |
| 680 | sleepssemaphore->post(); |
| 681 | |
| 682 | syncentchanges(); |
| 683 | physicsframe(); |
| 684 | checkweaponstate(); |
| 685 | if(getclientnum()>=0) shoot(player1, worldpos); // only shoot when connected to server |
| 686 | movebounceents(); |
| 687 | moveotherplayers(); |
| 688 | gets2c(); |
| 689 | showrespawntimer(); |
| 690 | |
| 691 | // Added by Rick: let bots think |
| 692 | if(m_botmode) BotManager.Think(); |
| 693 | |
| 694 | movelocalplayer(); |
| 695 | c2sinfo(player1); // do this last, to reduce the effective frame lag |
| 696 | } |
| 697 | |
| 698 | #define SECURESPAWNDIST 15 |
| 699 | int spawncycle = -1; |
no test coverage detected