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

Function shiftgametime

source/src/client.cpp:707–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705COMMAND(listdemos, "");
706
707void shiftgametime(int newmillis)
708{
709 if(!watchingdemo) { conoutf("You have to be watching a demo to change game time"); return; }
710
711 newmillis = max(0, newmillis);
712 if(newmillis > gametimemaximum) { conoutf("Invalid time specified"); return; }
713
714 int gamemillis = gametimecurrent + (lastmillis - lastgametimeupdate);
715 if(newmillis < gamemillis)
716 {
717 // if rewinding
718 if(!curdemofile || !curdemofile[0]) return;
719 watchingdemo = false;
720 callvote(SA_MAP, curdemofile, "-1", "0");
721 skipmillis = newmillis;
722 }
723 else
724 {
725 skipmillis = newmillis - gamemillis;
726 }
727}
728
729void setminutesremaining(char *minutes)
730{

Callers 2

setminutesremainingFunction · 0.85
rewinddemoFunction · 0.85

Calls 3

maxFunction · 0.85
callvoteFunction · 0.85
conoutfFunction · 0.70

Tested by

no test coverage detected