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

Function togglespect

source/src/clientgame.cpp:1817–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1815COMMANDF(spectatemode, "i", (int *mode) { spectatemode(*mode); });
1816
1817void togglespect() // cycle through all spectating modes
1818{
1819 int mode;
1820 if(player1->spectatemode==SM_NONE) mode = SM_FOLLOW1ST; // start with 1st person spect
1821 else mode = SM_FOLLOW1ST + ((player1->spectatemode - SM_FOLLOW1ST + 1) % ((smoverviewflyforbidden() ? SM_FLY : SM_NUM/*SM_OVERVIEW*/)-SM_FOLLOW1ST)); // replace SM_OVERVIEW by SM_NUM to enable overview mode
1822 spectatemode(mode);
1823}
1824COMMAND(togglespect, "");
1825
1826void changefollowplayer(int *shift)

Callers 2

jumpnFunction · 0.85
parsepositionsFunction · 0.85

Calls 2

smoverviewflyforbiddenFunction · 0.85
spectatemodeFunction · 0.85

Tested by

no test coverage detected