Przeglądaj źródła

Added portal command

Thomas Buck 11 lat temu
rodzic
commit
96059cce72
1 zmienionych plików z 20 dodań i 2 usunięć
  1. 20
    2
      src/OpenRaider.cpp

+ 20
- 2
src/OpenRaider.cpp Wyświetl plik

389
             getConsole().print("Invalid use of ralpha-command!");
389
             getConsole().print("Invalid use of ralpha-command!");
390
             return -25;
390
             return -25;
391
         }
391
         }
392
+    } else if (strcmp(command, "portal") == 0) {
393
+
394
+        if (args->size() > 0) {
395
+            bool b;
396
+            if (readBool(args->at(0), &b) < 0) {
397
+                getConsole().print("Pass BOOL to portal command!");
398
+                return -26;
399
+            }
400
+            if (b)
401
+                getRender().setFlags(Render::fPortals);
402
+            else
403
+                getRender().clearFlags(Render::fPortals);
404
+            getConsole().print("Portals are now %s", b ? "on" : "off");
405
+        } else {
406
+            getConsole().print("Invalid use of portal-command!");
407
+            return -27;
408
+        }
392
     } else if (strcmp(command, "help") == 0) {
409
     } else if (strcmp(command, "help") == 0) {
393
         if (args->size() == 0) {
410
         if (args->size() == 0) {
394
             getConsole().print("Available commands:");
411
             getConsole().print("Available commands:");
407
             getConsole().print("  pos       - Print position info");
424
             getConsole().print("  pos       - Print position info");
408
             getConsole().print("  vmodel    - BOOL - View Model");
425
             getConsole().print("  vmodel    - BOOL - View Model");
409
             getConsole().print("  ralpha    - BOOL - Room Alpha");
426
             getConsole().print("  ralpha    - BOOL - Room Alpha");
427
+            getConsole().print("  portal    - BOOL");
410
             getConsole().print("  help      - print command help");
428
             getConsole().print("  help      - print command help");
411
             getConsole().print("  quit      - exit OpenRaider");
429
             getConsole().print("  quit      - exit OpenRaider");
412
             getConsole().print("Use help COMMAND to get additional info");
430
             getConsole().print("Use help COMMAND to get additional info");
414
             return help(args->at(0));
432
             return help(args->at(0));
415
         } else {
433
         } else {
416
             getConsole().print("Invalid use of help-command");
434
             getConsole().print("Invalid use of help-command");
417
-            return -26;
435
+            return -28;
418
         }
436
         }
419
     } else {
437
     } else {
420
         getConsole().print("Unknown command: %s ", command);
438
         getConsole().print("Unknown command: %s ", command);
421
-        return -27;
439
+        return -29;
422
     }
440
     }
423
 
441
 
424
     return 0;
442
     return 0;

Ładowanie…
Anuluj
Zapisz