]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/player.qh
Move PM_ladder to ecs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / player.qh
index ea318c5b013f540801aa5fa2d196c5e5a8e9ea0a..5ce35dedceb80398e374662084de1bfe6b63f56e 100644 (file)
@@ -23,7 +23,7 @@
 .vector v_angle_old;
 .string lastclassname;
 
-.float() PlayerPhysplug;
+.float(entity) PlayerPhysplug;
 float AdjustAirAccelQW(float accelqw, float factor);
 
 bool IsFlying(entity a);
@@ -99,6 +99,15 @@ bool IsFlying(entity a);
 #define PHYS_INPUT_BUTTON_ZOOM(s)           PHYS_INPUT_BUTTON_BUTTON4(s)
 #define PHYS_INPUT_BUTTON_CROUCH(s)         PHYS_INPUT_BUTTON_BUTTON5(s)
 #define PHYS_INPUT_BUTTON_HOOK(s)           PHYS_INPUT_BUTTON_BUTTON6(s)
+
+#ifdef CSQC
+STATIC_INIT(PHYS_INPUT_BUTTON_HOOK)
+{
+       localcmd("alias +hook +button6\n");
+       localcmd("alias -hook -button6\n");
+}
+#endif
+
 #define PHYS_INPUT_BUTTON_INFO(s)           PHYS_INPUT_BUTTON_BUTTON7(s)
 #define PHYS_INPUT_BUTTON_DRAG(s)           PHYS_INPUT_BUTTON_BUTTON8(s)
 #define PHYS_INPUT_BUTTON_USE(s)            PHYS_INPUT_BUTTON_BUTTON_USE(s)
@@ -107,6 +116,14 @@ bool IsFlying(entity a);
 #define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s)     PHYS_INPUT_BUTTON_BUTTON9(s)
 #define PHYS_INPUT_BUTTON_JETPACK(s)        PHYS_INPUT_BUTTON_BUTTON10(s)
 
+#ifdef CSQC
+STATIC_INIT(PHYS_INPUT_BUTTON_JETPACK)
+{
+       localcmd("alias +jetpack +button10\n");
+    localcmd("alias -jetpack -button10\n");
+}
+#endif
+
 // if more buttons are needed, start using impulse bits as buttons
 
 #define PHYS_INPUT_BUTTON_BACKWARD(s)       (PHYS_INPUT_MOVEVALUES(s).x < 0)
@@ -138,13 +155,20 @@ bool IsFlying(entity a);
 
 #define ITEMS_STAT(s)                       ((s).items)
 
+.float teleport_time;
+#define PHYS_TELEPORT_TIME(s)               ((s).teleport_time)
+
+.float waterjump_time;
+#define PHYS_WATERJUMP_TIME(s)               ((s).waterjump_time)
+
 #ifdef CSQC
 
+       #define PHYS_FIXANGLE(s) ('0 0 0')
+       #define PHYS_MOVETYPE(s) ((s).move_movetype)
+
        string autocvar_cl_jumpspeedcap_min;
        string autocvar_cl_jumpspeedcap_max;
 
-       noref float pmove_waterjumptime;
-
        const int FL_WATERJUMP = 2048;  // player jumping out of water
        const int FL_JUMPRELEASED = 4096;  // for jump debouncing
 
@@ -155,6 +179,8 @@ bool IsFlying(entity a);
        .vector movement;
        .vector v_angle;
 
+       .entity hook;
+
 // TODO
        #define IS_CLIENT(s)                        ((s).isplayermodel)
        #define IS_PLAYER(s)                        ((s).isplayermodel)
@@ -166,8 +192,6 @@ bool IsFlying(entity a);
 
        #define PHYS_GRAVITY(s)                     STAT(MOVEVARS_GRAVITY, s)
 
-       #define PHYS_TELEPORT_TIME(s)               ((s).teleport_time)
-
        #define TICRATE                             ticrate
 
        #define PHYS_INPUT_ANGLES(s)                input_angles
@@ -216,6 +240,9 @@ bool IsFlying(entity a);
 
 #elif defined(SVQC)
 
+       #define PHYS_FIXANGLE(s) ((s).fixangle)
+       #define PHYS_MOVETYPE(s) ((s).movetype)
+
        bool Physics_Valid(string thecvar);
 
        .float stat_sv_airspeedlimit_nonqw = _STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW);
@@ -225,8 +252,6 @@ bool IsFlying(entity a);
        .string jumpspeedcap_min;
        .string jumpspeedcap_max;
 
-       #define PHYS_TELEPORT_TIME(s)               ((s).teleport_time)
-
        #define PHYS_GRAVITY(s)                     autocvar_sv_gravity
 
        #define TICRATE sys_frametime