]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/bool.qh
Fix cl_rollkillspeed causing the view to flicker a lot when dead if v_deathtilt is...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / bool.qh
1 #pragma once
2
3 #ifndef QCC_SUPPORT_BOOL
4         // Boolean Constants
5         const int true  = 1;
6         const int false = 0;
7 #endif
8
9 #define boolean(value) ((value) != 0)
10
11 // get true/false value of a string with multiple different inputs
12 float InterpretBoolean(string input)
13 {
14         switch (strtolower(input))
15         {
16                 case "yes":
17                 case "true":
18                 case "on":
19                         return true;
20
21                 case "no":
22                 case "false":
23                 case "off":
24                         return false;
25
26                 default: return boolean(stof(input));
27         }
28 }