]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/player.qh
Some more cleanup of defs.qh, use a flag to indicate crouch state instead of a separa...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / player.qh
index fc11cfab263185de02d7ccd67f3ce06069693fe3..4efb16f9d2ca35f53e39bb50c7612c865bf92a15 100644 (file)
@@ -7,6 +7,8 @@
        #include <common/state.qh>
 #endif
 
+const int FL_DUCKED = BIT(19);
+
 .entity conveyor;
 
 .float race_penalty;
@@ -155,6 +157,10 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
 #define WAS_ONGROUND(s)                     boolean((s).lastflags & FL_ONGROUND)
 #define WAS_ONSLICK(s)                      boolean((s).lastflags & FL_ONSLICK)
 
+#define IS_DUCKED(s)                        (boolean((s).flags & FL_DUCKED))
+#define SET_DUCKED(s)                       ((s).flags |= FL_DUCKED)
+#define UNSET_DUCKED(s)                     ((s).flags &= ~FL_DUCKED)
+
 #define ITEMS_STAT(s)                       ((s).items)
 
 .float teleport_time;
@@ -224,10 +230,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
        #define PHYS_INPUT_BUTTON_BUTTON15(s)       boolean(input_buttons & BIT(17))
        #define PHYS_INPUT_BUTTON_BUTTON16(s)       boolean(input_buttons & BIT(18))
 
-       #define IS_DUCKED(s)                        (boolean((s).flags & FL_DUCKED))
-       #define SET_DUCKED(s)                       ((s).flags |= FL_DUCKED)
-       #define UNSET_DUCKED(s)                     ((s).flags &= ~FL_DUCKED)
-
        #define PHYS_INVEHICLE(s)                                       (boolean(hud != HUD_NORMAL))
 
        #define PHYS_JUMPSPEEDCAP_MIN               autocvar_cl_jumpspeedcap_min
@@ -278,10 +280,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
        #define PHYS_INPUT_BUTTON_BUTTON15(s)       (CS(s).button15)
        #define PHYS_INPUT_BUTTON_BUTTON16(s)       (CS(s).button16)
 
-       #define IS_DUCKED(s)                        ((s).crouch)
-       #define SET_DUCKED(s)                       ((s).crouch = true)
-       #define UNSET_DUCKED(s)                     ((s).crouch = false)
-
        #define PHYS_INVEHICLE(s)                                       (boolean((s).vehicle != NULL))
 
        #define PHYS_JUMPSPEEDCAP_MIN               autocvar_sv_jumpspeedcap_min