1 // Client/server mappings
5 #define PHYS_INPUT_ANGLES(s) input_angles
6 #define PHYS_INPUT_BUTTONS(s) input_buttons
7 #define PHYS_INPUT_TIMELENGTH input_timelength
8 #define PHYS_INPUT_MOVEVALUES(s) input_movevalues
10 #define PHYS_WORLD_ANGLES(s) input_angles
12 #define PHYS_DEAD(s) s.csqcmodel_isdead
14 #define PHYS_BUTTON_HOOK(s) (input_buttons & 32)
16 #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE
17 #define GAMEPLAYFIX_NOGRAVITYONGROUND cvar("sv_gameplayfix_nogravityonground")
18 #define GAMEPLAYFIX_Q2AIRACCELERATE cvar("sv_gameplayfix_q2airaccelerate")
20 #define IS_DUCKED(s) (s.pmove_flags & PMF_DUCKED)
21 #define SET_DUCKED(s) s.pmove_flags |= PMF_DUCKED
22 #define UNSET_DUCKED(s) s.pmove_flags &= ~PMF_DUCKED
24 #define IS_JUMP_HELD(s) (s.pmove_flags & PMF_JUMP_HELD)
25 #define SET_JUMP_HELD(s) s.pmove_flags |= PMF_JUMP_HELD
26 #define UNSET_JUMP_HELD(s) s.pmove_flags &= ~PMF_JUMP_HELD
28 #define IS_ONGROUND(s) (s.pmove_flags & PMF_ONGROUND)
29 #define SET_ONGROUND(s) s.pmove_flags |= PMF_ONGROUND
30 #define UNSET_ONGROUND(s) s.pmove_flags &= ~PMF_ONGROUND
32 #define ITEMS(s) getstati(STAT_ITEMS, 0, 24)
34 #define PHYS_AMMO_FUEL(s) getstati(STAT_FUEL)
36 #define PHYS_FROZEN(s) getstati(STAT_FROZEN)
38 #define PHYS_ACCELERATE getstatf(STAT_MOVEVARS_ACCELERATE)
39 #define PHYS_AIRACCEL_QW(s) getstatf(STAT_MOVEVARS_AIRACCEL_QW)
40 #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s) getstatf(STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR)
41 #define PHYS_AIRACCEL_SIDEWAYS_FRICTION getstatf(STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION)
42 #define PHYS_AIRACCELERATE getstatf(STAT_MOVEVARS_AIRACCELERATE)
43 #define PHYS_AIRCONTROL getstatf(STAT_MOVEVARS_AIRCONTROL)
44 #define PHYS_AIRCONTROL_PENALTY getstatf(STAT_MOVEVARS_AIRCONTROL_PENALTY)
45 #define PHYS_AIRCONTROL_POWER getstatf(STAT_MOVEVARS_AIRCONTROL_POWER)
46 #define PHYS_AIRSPEEDLIMIT_NONQW(s) getstatf(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW)
47 #define PHYS_AIRSTOPACCELERATE getstatf(STAT_MOVEVARS_AIRSTOPACCELERATE)
48 #define PHYS_AIRSTRAFEACCEL_QW(s) getstatf(STAT_MOVEVARS_AIRSTRAFEACCEL_QW)
49 #define PHYS_AIRSTRAFEACCELERATE getstatf(STAT_MOVEVARS_AIRSTRAFEACCELERATE)
50 #define PHYS_ENTGRAVITY(s) getstatf(STAT_MOVEVARS_ENTGRAVITY)
51 #define PHYS_FRICTION getstatf(STAT_MOVEVARS_FRICTION)
52 #define PHYS_GRAVITY getstatf(STAT_MOVEVARS_GRAVITY)
53 #define PHYS_HIGHSPEED getstatf(STAT_MOVEVARS_HIGHSPEED)
54 #define PHYS_JUMPVELOCITY getstatf(STAT_MOVEVARS_JUMPVELOCITY)
55 #define PHYS_MAXAIRSPEED getstatf(STAT_MOVEVARS_MAXAIRSPEED)
56 #define PHYS_MAXAIRSTRAFESPEED getstatf(STAT_MOVEVARS_MAXAIRSTRAFESPEED)
57 #define PHYS_MAXSPEED(s) getstatf(STAT_MOVEVARS_MAXSPEED)
58 #define PHYS_STEPHEIGHT getstatf(STAT_MOVEVARS_STEPHEIGHT)
59 #define PHYS_STOPSPEED getstatf(STAT_MOVEVARS_STOPSPEED)
60 #define PHYS_WARSOWBUNNY_ACCEL getstatf(STAT_MOVEVARS_WARSOWBUNNY_ACCEL)
61 #define PHYS_WARSOWBUNNY_BACKTOSIDERATIO getstatf(STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO)
62 #define PHYS_WARSOWBUNNY_AIRFORWARDACCEL getstatf(STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL)
63 #define PHYS_WARSOWBUNNY_TOPSPEED getstatf(STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED)
64 #define PHYS_WARSOWBUNNY_TURNACCEL getstatf(STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL)
66 #define PHYS_JETPACK_ACCEL_UP getstatf(STAT_JETPACK_ACCEL_UP)
67 #define PHYS_JETPACK_ACCEL_SIDE getstatf(STAT_JETPACK_ACCEL_SIDE)
68 #define PHYS_JETPACK_ANTIGRAVITY getstatf(STAT_JETPACK_ANTIGRAVITY)
69 #define PHYS_JETPACK_FUEL getstatf(STAT_JETPACK_FUEL)
70 #define PHYS_JETPACK_MAXSPEED_UP getstatf(STAT_JETPACK_MAXSPEED_UP)
71 #define PHYS_JETPACK_MAXSPEED_SIDE getstatf(STAT_JETPACK_MAXSPEED_SIDE)
73 #define PHYS_DODGING_FRAMETIME (1 / frametime <= 0 ? 60 : frametime)
74 #define PHYS_DODGING getstati(STAT_DODGING)
75 #define PHYS_DODGING_DELAY getstatf(STAT_DODGING_DELAY)
76 #define PHYS_DODGING_TIMEOUT(s) getstatf(STAT_DODGING_TIMEOUT)
77 #define PHYS_DODGING_HORIZ_SPEED_FROZEN getstatf(STAT_DODGING_HORIZ_SPEED_FROZEN)
78 #define PHYS_DODGING_FROZEN getstati(STAT_DODGING_FROZEN)
79 #define PHYS_DODGING_FROZEN_NODOUBLETAP getstati(STAT_DODGING_FROZEN_NO_DOUBLETAP)
80 #define PHYS_DODGING_HORIZ_SPEED getstatf(STAT_DODGING_HORIZ_SPEED)
81 #define PHYS_DODGING_PRESSED_KEYS(s) s.pressedkeys
82 #define PHYS_DODGING_HEIGHT_THRESHOLD getstatf(STAT_DODGING_HEIGHT_THRESHOLD)
83 #define PHYS_DODGING_DISTANCE_THRESHOLD getstatf(STAT_DODGING_DISTANCE_THRESHOLD)
84 #define PHYS_DODGING_RAMP_TIME getstatf(STAT_DODGING_RAMP_TIME)
85 #define PHYS_DODGING_UP_SPEED getstatf(STAT_DODGING_UP_SPEED)
86 #define PHYS_DODGING_WALL getstatf(STAT_DODGING_WALL)
90 #define PHYS_INPUT_ANGLES(s) s.v_angle
92 #define PHYS_INPUT_BUTTONS(s) (s.BUTTON_ATCK + 2 * s.BUTTON_JUMP + 4 * s.BUTTON_ATCK2 + 8 * s.BUTTON_ZOOM + 16 * s.BUTTON_CROUCH + 32 * s.BUTTON_HOOK + 64 * s.BUTTON_USE + 128 * (s.movement_x < 0) + 256 * (s.movement_x > 0) + 512 * (s.movement_y < 0) + 1024 * (s.movement_y > 0))
93 #define PHYS_INPUT_TIMELENGTH frametime
94 #define PHYS_INPUT_MOVEVALUES(s) s.movement
96 #define PHYS_WORLD_ANGLES(s) s.angles
98 #define PHYS_DEAD(s) s.deadflag != DEAD_NO
100 #define PHYS_BUTTON_HOOK(s) s.BUTTON_HOOK
102 #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE autocvar_sv_gameplayfix_gravityunaffectedbyticrate
103 #define GAMEPLAYFIX_NOGRAVITYONGROUND cvar("sv_gameplayfix_nogravityonground")
104 #define GAMEPLAYFIX_Q2AIRACCELERATE autocvar_sv_gameplayfix_q2airaccelerate
106 #define IS_DUCKED(s) s.crouch
107 #define SET_DUCKED(s) s.crouch = TRUE
108 #define UNSET_DUCKED(s) s.crouch = FALSE
110 #define IS_JUMP_HELD(s) (s.flags & FL_JUMPRELEASED == 0)
111 #define SET_JUMP_HELD(s) s.flags &= ~FL_JUMPRELEASED
112 #define UNSET_JUMP_HELD(s) s.flags |= FL_JUMPRELEASED
114 #define IS_ONGROUND(s) (s.flags & FL_ONGROUND)
115 #define SET_ONGROUND(s) s.flags |= FL_ONGROUND
116 #define UNSET_ONGROUND(s) s.flags &= ~FL_ONGROUND
118 #define ITEMS(s) s.items
120 #define PHYS_AMMO_FUEL(s) s.ammo_fuel
122 #define PHYS_FROZEN(s) s.frozen
124 #define PHYS_ACCELERATE autocvar_sv_accelerate
125 #define PHYS_AIRACCEL_QW(s) s.stat_sv_airaccel_qw
126 #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s) autocvar_sv_airaccel_qw_stretchfactor
127 #define PHYS_AIRACCEL_SIDEWAYS_FRICTION autocvar_sv_airaccel_sideways_friction
128 #define PHYS_AIRACCELERATE autocvar_sv_airaccelerate
129 #define PHYS_AIRCONTROL autocvar_sv_aircontrol
130 #define PHYS_AIRCONTROL_PENALTY autocvar_sv_aircontrol_penalty
131 #define PHYS_AIRCONTROL_POWER autocvar_sv_aircontrol_power
132 #define PHYS_AIRSPEEDLIMIT_NONQW(s) s.stat_sv_airspeedlimit_nonqw
133 #define PHYS_AIRSTOPACCELERATE autocvar_sv_airstopaccelerate
134 #define PHYS_AIRSTRAFEACCEL_QW(s) s.stat_sv_airstrafeaccel_qw
135 #define PHYS_AIRSTRAFEACCELERATE autocvar_sv_airstrafeaccelerate
136 #define PHYS_ENTGRAVITY(s) s.gravity
137 #define PHYS_FRICTION autocvar_sv_friction
138 #define PHYS_GRAVITY autocvar_sv_gravity
139 #define PHYS_HIGHSPEED autocvar_g_movement_highspeed
140 #define PHYS_JUMPVELOCITY autocvar_sv_jumpvelocity
141 #define PHYS_MAXAIRSPEED autocvar_sv_maxairspeed
142 #define PHYS_MAXAIRSTRAFESPEED autocvar_sv_maxairstrafespeed
143 #define PHYS_MAXSPEED(s) s.stat_sv_maxspeed
144 #define PHYS_STEPHEIGHT autocvar_sv_stepheight
145 #define PHYS_STOPSPEED autocvar_sv_stopspeed
146 #define PHYS_WARSOWBUNNY_ACCEL autocvar_sv_warsowbunny_accel
147 #define PHYS_WARSOWBUNNY_BACKTOSIDERATIO autocvar_sv_warsowbunny_backtosideratio
148 #define PHYS_WARSOWBUNNY_AIRFORWARDACCEL autocvar_sv_warsowbunny_airforwardaccel
149 #define PHYS_WARSOWBUNNY_TOPSPEED autocvar_sv_warsowbunny_topspeed
150 #define PHYS_WARSOWBUNNY_TURNACCEL autocvar_sv_warsowbunny_turnaccel
152 #define PHYS_JETPACK_ACCEL_UP autocvar_g_jetpack_acceleration_up
153 #define PHYS_JETPACK_ACCEL_SIDE autocvar_g_jetpack_acceleration_side
154 #define PHYS_JETPACK_ANTIGRAVITY autocvar_g_jetpack_antigravity
155 #define PHYS_JETPACK_FUEL autocvar_g_jetpack_fuel
156 #define PHYS_JETPACK_MAXSPEED_UP autocvar_g_jetpack_maxspeed_up
157 #define PHYS_JETPACK_MAXSPEED_SIDE autocvar_g_jetpack_maxspeed_side
159 #define PHYS_DODGING_FRAMETIME sys_frametime
160 #define PHYS_DODGING g_dodging
161 #define PHYS_DODGING_DELAY autocvar_sv_dodging_delay
162 #define PHYS_DODGING_TIMEOUT(s) s.cvar_cl_dodging_timeout
163 #define PHYS_DODGING_HORIZ_SPEED_FROZEN autocvar_sv_dodging_horiz_speed_frozen
164 #define PHYS_DODGING_FROZEN autocvar_sv_dodging_frozen
165 #define PHYS_DODGING_FROZEN_NODOUBLETAP autocvar_sv_dodging_frozen_doubletap
166 #define PHYS_DODGING_HORIZ_SPEED autocvar_sv_dodging_horiz_speed
167 #define PHYS_DODGING_PRESSED_KEYS(s) s.pressedkeys
168 #define PHYS_DODGING_HEIGHT_THRESHOLD autocvar_sv_dodging_height_threshold
169 #define PHYS_DODGING_DISTANCE_THRESHOLD autocvar_sv_dodging_wall_distance_threshold
170 #define PHYS_DODGING_RAMP_TIME autocvar_sv_dodging_ramp_time
171 #define PHYS_DODGING_UP_SPEED autocvar_sv_dodging_up_speed
172 #define PHYS_DODGING_WALL autocvar_sv_dodging_wall_dodging