Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*cl_demo.cpp*/
- // [IBM] The map that's going to be skipped | 0 = there's nothing to be skipped, else there's a map to be skipped
- static BYTE *g_SkipToMap = 0;
- //*****************************************************************************
- // CONSOLE COMMANDS
- CCMD(demo_skiptomap)
- {
- // This command shouldn't do anything if a demo isn't playing.
- if (CLIENTDEMO_IsPlaying() == false){
- if (argv.argc() == 1)
- {
- Printf("Usage: demo_skiptomap <map name>");
- }
- else if (argv.argc() > 2)
- {
- Printf("Too many arguments.");
- }
- else {
- g_SkipToMap = argv.args[1];
- }
- }
- }
- //*****************************************************************************
- //
- bool CLIENTDEMO_IsSkippingToMap(BYTE *ActualMap) {
- if (g_SkipToMap) {
- int i = 0;
- while (g_SkipToMap[i] != '\0' && ActualMap[i] != '\0' && g_SkipToMap[i] == ActualMap[i])
- {
- i++;
- }
- if (g_SkipToMap[i] == '\0' && ActualMap[i] == '\0') {//They are equal, so we stop here
- free(g_SkipToMap);
- g_SkipToMap = NULL;
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement