]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/player.qh
Port v_angle_old to ClientState
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / player.qh
index 4af97abdc6af321da7940f8f98f2389d6ab9a677..23456ebbe74e91c2a95805327c22de92317d2806 100644 (file)
@@ -2,6 +2,11 @@
 
 // Client/server mappings
 
+#ifdef SVQC
+// TODO: get rid of this random dumb include!
+       #include <common/state.qh>
+#endif
+
 .entity conveyor;
 
 .float race_penalty;
@@ -17,8 +22,8 @@
 .float spectatorspeed;
 #endif
 
+.int buttons_old;
 .vector movement_old;
-.float buttons_old;
 .vector v_angle_old;
 .string lastclassname;
 
@@ -206,6 +211,7 @@ STATIC_INIT(PHYS_INPUT_BUTTON_DODGE)
        #define PHYS_INPUT_FRAMETIME                serverdeltatime
 
        #define PHYS_INPUT_MOVEVALUES(s)            input_movevalues
+       #define PHYS_CS(s)                          (s)
 
        #define PHYS_INPUT_BUTTON_BUTTON1(s)        boolean(input_buttons & BIT(0))
        #define PHYS_INPUT_BUTTON_BUTTON2(s)        boolean(input_buttons & BIT(1))
@@ -242,7 +248,9 @@ STATIC_INIT(PHYS_INPUT_BUTTON_DODGE)
 
        bool Physics_Valid(string thecvar);
 
-       void Physics_UpdateStats(entity this, float maxspd_mod);
+       void Physics_UpdateStats(entity this);
+
+       void PM_UpdateButtons(entity this, entity store);
 
        .float stat_sv_airspeedlimit_nonqw = _STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW);
        .float stat_sv_maxspeed = _STAT(MOVEVARS_MAXSPEED);
@@ -257,27 +265,28 @@ STATIC_INIT(PHYS_INPUT_BUTTON_DODGE)
        #define PHYS_INPUT_TIMELENGTH               frametime
        #define PHYS_INPUT_FRAMETIME                sys_frametime
 
-       #define PHYS_INPUT_MOVEVALUES(s)            ((s).movement)
-
-       #define PHYS_INPUT_BUTTON_BUTTON1(s)        ((s).button0)
-       #define PHYS_INPUT_BUTTON_BUTTON2(s)        ((s).button2)
-       #define PHYS_INPUT_BUTTON_BUTTON3(s)        ((s).button3)
-       #define PHYS_INPUT_BUTTON_BUTTON4(s)        ((s).button4)
-       #define PHYS_INPUT_BUTTON_BUTTON5(s)        ((s).button5)
-       #define PHYS_INPUT_BUTTON_BUTTON6(s)        ((s).button6)
-       #define PHYS_INPUT_BUTTON_BUTTON7(s)        ((s).button7)
-       #define PHYS_INPUT_BUTTON_BUTTON8(s)        ((s).button8)
-       #define PHYS_INPUT_BUTTON_BUTTON_USE(s)     ((s).buttonuse)
-       #define PHYS_INPUT_BUTTON_BUTTON_CHAT(s)    ((s).buttonchat)
-       #define PHYS_INPUT_BUTTON_BUTTON_PRYDON(s)  ((s).cursor_active)
-       #define PHYS_INPUT_BUTTON_BUTTON9(s)        ((s).button9)
-       #define PHYS_INPUT_BUTTON_BUTTON10(s)       ((s).button10)
-       #define PHYS_INPUT_BUTTON_BUTTON11(s)       ((s).button11)
-       #define PHYS_INPUT_BUTTON_BUTTON12(s)       ((s).button12)
-       #define PHYS_INPUT_BUTTON_BUTTON13(s)       ((s).button13)
-       #define PHYS_INPUT_BUTTON_BUTTON14(s)       ((s).button14)
-       #define PHYS_INPUT_BUTTON_BUTTON15(s)       ((s).button15)
-       #define PHYS_INPUT_BUTTON_BUTTON16(s)       ((s).button16)
+       #define PHYS_INPUT_MOVEVALUES(s)            CS(s).movement
+       #define PHYS_CS(s)                          CS(s)
+
+       #define PHYS_INPUT_BUTTON_BUTTON1(s)        (CS(s).button0)
+       #define PHYS_INPUT_BUTTON_BUTTON2(s)        (CS(s).button2)
+       #define PHYS_INPUT_BUTTON_BUTTON3(s)        (CS(s).button3)
+       #define PHYS_INPUT_BUTTON_BUTTON4(s)        (CS(s).button4)
+       #define PHYS_INPUT_BUTTON_BUTTON5(s)        (CS(s).button5)
+       #define PHYS_INPUT_BUTTON_BUTTON6(s)        (CS(s).button6)
+       #define PHYS_INPUT_BUTTON_BUTTON7(s)        (CS(s).button7)
+       #define PHYS_INPUT_BUTTON_BUTTON8(s)        (CS(s).button8)
+       #define PHYS_INPUT_BUTTON_BUTTON_USE(s)     (CS(s).buttonuse)
+       #define PHYS_INPUT_BUTTON_BUTTON_CHAT(s)    (CS(s).buttonchat)
+       #define PHYS_INPUT_BUTTON_BUTTON_PRYDON(s)  (CS(s).cursor_active)
+       #define PHYS_INPUT_BUTTON_BUTTON9(s)        (CS(s).button9)
+       #define PHYS_INPUT_BUTTON_BUTTON10(s)       (CS(s).button10)
+       #define PHYS_INPUT_BUTTON_BUTTON11(s)       (CS(s).button11)
+       #define PHYS_INPUT_BUTTON_BUTTON12(s)       (CS(s).button12)
+       #define PHYS_INPUT_BUTTON_BUTTON13(s)       (CS(s).button13)
+       #define PHYS_INPUT_BUTTON_BUTTON14(s)       (CS(s).button14)
+       #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)