MCPcopy Create free account
hub / github.com/assaultcube/AC / updateworld

Function updateworld

source/src/clientgame.cpp:663–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661COMMANDF(resetsleeps, "", (void) { resetsleep(true); });
662
663void 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
699int spawncycle = -1;

Callers 1

main.cppFile · 0.85

Calls 14

syncentchangesFunction · 0.85
physicsframeFunction · 0.85
checkweaponstateFunction · 0.85
getclientnumFunction · 0.85
shootFunction · 0.85
movebounceentsFunction · 0.85
moveotherplayersFunction · 0.85
gets2cFunction · 0.85
showrespawntimerFunction · 0.85
movelocalplayerFunction · 0.85
c2sinfoFunction · 0.85
waitMethod · 0.80

Tested by

no test coverage detected