set sv_friction_on_land 0
set sv_friction_slick 0.5
+set sv_slick_applygravity 0
+
set sv_aircontrol_backwards 0 "apply forward aircontrol options to backward movement"
set sv_player_viewoffset "0 0 35" "view offset of the player model"
#define IS_ONGROUND(s) boolean((s).flags & FL_ONGROUND)
#define SET_ONGROUND(s) ((s).flags |= FL_ONGROUND)
#define UNSET_ONGROUND(s) ((s).flags &= ~FL_ONGROUND)
+#define IS_ONSLICK(s) boolean((s).flags & FL_ONSLICK)
+#define SET_ONSLICK(s) ((s).flags |= FL_ONSLICK)
+#define UNSET_ONSLICK(s) ((s).flags &= ~FL_ONSLICK)
#ifdef CSQC
.float bouncestop;
const int MOVETYPE_ANGLECLIP = 2;
#endif
+const int FL_ONSLICK = BIT(20);
+
const int MOVETYPE_FAKEPUSH = 13;
const int MOVEFLAG_VALID = BIT(23);
}
if (!doublejump)
- if (!IS_ONGROUND(this))
+ if (!IS_ONGROUND(this) && !IS_ONSLICK(this))
return IS_JUMP_HELD(this);
bool track_jump = PHYS_CL_TRACK_CANJUMP(this);
}
}
- if (!WAS_ONGROUND(this))
+ if (!WAS_ONGROUND(this) && !WAS_ONSLICK(this))
{
#ifdef SVQC
if(autocvar_speedmeter)
this.velocity_z += mjumpheight;
UNSET_ONGROUND(this);
+ UNSET_ONSLICK(this);
SET_JUMP_HELD(this);
#ifdef SVQC
#endif
}
+void PM_check_slick(entity this)
+{
+ if(!IS_ONGROUND(this))
+ return;
+
+ if(!PHYS_SLICK_APPLYGRAVITY(this))
+ return;
+
+ tracebox(this.origin, this.mins, this.maxs, this.origin - '0 0 1', MOVE_NOMONSTERS, this);
+ if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK)
+ {
+ UNSET_ONGROUND(this);
+ SET_ONSLICK(this);
+ }
+ else
+ UNSET_ONSLICK(this);
+}
+
void PM_check_blocked(entity this)
{
#ifdef SVQC
#define UPWARD_VELOCITY_CLEARS_ONGROUND(s) STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, s)
+#define PHYS_SLICK_APPLYGRAVITY(s) STAT(SLICK_APPLYGRAVITY, s)
+
#define PHYS_INPUT_BUTTON_ATCK(s) PHYS_INPUT_BUTTON_BUTTON1(s)
#define PHYS_INPUT_BUTTON_JUMP(s) PHYS_INPUT_BUTTON_BUTTON2(s)
#define PHYS_INPUT_BUTTON_ATCK2(s) PHYS_INPUT_BUTTON_BUTTON3(s)
#define UNSET_JUMP_HELD(s) ((s).flags |= FL_JUMPRELEASED)
#define WAS_ONGROUND(s) boolean((s).lastflags & FL_ONGROUND)
+#define WAS_ONSLICK(s) boolean((s).lastflags & FL_ONSLICK)
#define ITEMS_STAT(s) ((s).items)
REGISTER_STAT(SPECTATORSPEED, float)
+#ifdef SVQC
+bool autocvar_sv_slick_applygravity;
+#endif
+REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity)
+
#ifdef SVQC
#include "physics/movetypes/movetypes.qh"
#endif
goto end;
}
+ PM_check_slick(this);
+
if (IS_SVQC && !PHYS_FIXANGLE(this)) { this.angles = '0 1 0' * this.v_angle.y; }
if (IS_PLAYER(this)) {
if (IS_ONGROUND(this)) {