// Client/server mappings #ifdef CSQC float player_multijump; float player_jumpheight; #define PHYS_INPUT_ANGLES(s) input_angles // TODO #define PHYS_WORLD_ANGLES(s) input_angles #define PHYS_INPUT_TIMELENGTH input_timelength #define PHYS_INPUT_MOVEVALUES(s) input_movevalues #define PHYS_INPUT_BUTTON_MASK(s) (input_buttons | 128 * (input_movevalues_x < 0) | 256 * (input_movevalues_x > 0) | 512 * (input_movevalues_y < 0) | 1024 * (input_movevalues_y > 0)) #define PHYS_INPUT_BUTTON_ATCK(s) (input_buttons & 1) #define PHYS_INPUT_BUTTON_JUMP(s) (input_buttons & 2) #define PHYS_INPUT_BUTTON_ATCK2(s) (input_buttons & 4) #define PHYS_INPUT_BUTTON_ZOOM(s) (input_buttons & 8) #define PHYS_INPUT_BUTTON_CROUCH(s) (input_buttons & 16) #define PHYS_INPUT_BUTTON_HOOK(s) (input_buttons & 32) #define PHYS_INPUT_BUTTON_USE(s) (input_buttons & 64) #define PHYS_INPUT_BUTTON_BACKWARD(s) (input_buttons & 128) #define PHYS_INPUT_BUTTON_FORWARD(s) (input_buttons & 256) #define PHYS_INPUT_BUTTON_LEFT(s) (input_buttons & 512) #define PHYS_INPUT_BUTTON_RIGHT(s) (input_buttons & 1024) #define PHYS_DEAD(s) s.csqcmodel_isdead #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE #define GAMEPLAYFIX_NOGRAVITYONGROUND cvar("sv_gameplayfix_nogravityonground") #define GAMEPLAYFIX_Q2AIRACCELERATE cvar("sv_gameplayfix_q2airaccelerate") #define IS_DUCKED(s) (s.pmove_flags & PMF_DUCKED) #define SET_DUCKED(s) s.pmove_flags |= PMF_DUCKED #define UNSET_DUCKED(s) s.pmove_flags &= ~PMF_DUCKED #define IS_JUMP_HELD(s) (s.pmove_flags & PMF_JUMP_HELD) #define SET_JUMP_HELD(s) s.pmove_flags |= PMF_JUMP_HELD #define UNSET_JUMP_HELD(s) s.pmove_flags &= ~PMF_JUMP_HELD #define IS_ONGROUND(s) (s.pmove_flags & PMF_ONGROUND) #define SET_ONGROUND(s) s.pmove_flags |= PMF_ONGROUND #define UNSET_ONGROUND(s) s.pmove_flags &= ~PMF_ONGROUND #define ITEMS(s) getstati(STAT_ITEMS, 0, 24) #define PHYS_AMMO_FUEL(s) getstati(STAT_FUEL) #define PHYS_FROZEN(s) getstati(STAT_FROZEN) #define PHYS_DOUBLEJUMP getstati(STAT_DOUBLEJUMP) #define PHYS_JUMPSPEEDCAP_MIN getstatf(STAT_MOVEVARS_JUMPSPEEDCAP_MIN) #define PHYS_JUMPSPEEDCAP_MAX getstatf(STAT_MOVEVARS_JUMPSPEEDCAP_MAX) #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS getstati(STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS) #define PHYS_TRACK_CANJUMP(s) getstati(STAT_MOVEVARS_TRACK_CANJUMP) #define PHYS_ACCELERATE getstatf(STAT_MOVEVARS_ACCELERATE) #define PHYS_AIRACCEL_QW(s) getstatf(STAT_MOVEVARS_AIRACCEL_QW) #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s) getstatf(STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR) #define PHYS_AIRACCEL_SIDEWAYS_FRICTION getstatf(STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION) #define PHYS_AIRACCELERATE getstatf(STAT_MOVEVARS_AIRACCELERATE) #define PHYS_AIRCONTROL getstatf(STAT_MOVEVARS_AIRCONTROL) #define PHYS_AIRCONTROL_PENALTY getstatf(STAT_MOVEVARS_AIRCONTROL_PENALTY) #define PHYS_AIRCONTROL_POWER getstatf(STAT_MOVEVARS_AIRCONTROL_POWER) #define PHYS_AIRSPEEDLIMIT_NONQW(s) getstatf(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW) #define PHYS_AIRSTOPACCELERATE getstatf(STAT_MOVEVARS_AIRSTOPACCELERATE) #define PHYS_AIRSTRAFEACCEL_QW(s) getstatf(STAT_MOVEVARS_AIRSTRAFEACCEL_QW) #define PHYS_AIRSTRAFEACCELERATE getstatf(STAT_MOVEVARS_AIRSTRAFEACCELERATE) #define PHYS_ENTGRAVITY(s) getstatf(STAT_MOVEVARS_ENTGRAVITY) #define PHYS_FRICTION getstatf(STAT_MOVEVARS_FRICTION) #define PHYS_GRAVITY getstatf(STAT_MOVEVARS_GRAVITY) #define PHYS_HIGHSPEED getstatf(STAT_MOVEVARS_HIGHSPEED) #define PHYS_JUMPVELOCITY getstatf(STAT_MOVEVARS_JUMPVELOCITY) #define PHYS_MAXAIRSPEED getstatf(STAT_MOVEVARS_MAXAIRSPEED) #define PHYS_MAXAIRSTRAFESPEED getstatf(STAT_MOVEVARS_MAXAIRSTRAFESPEED) #define PHYS_MAXSPEED(s) getstatf(STAT_MOVEVARS_MAXSPEED) #define PHYS_STEPHEIGHT getstatf(STAT_MOVEVARS_STEPHEIGHT) #define PHYS_STOPSPEED getstatf(STAT_MOVEVARS_STOPSPEED) #define PHYS_WARSOWBUNNY_ACCEL getstatf(STAT_MOVEVARS_WARSOWBUNNY_ACCEL) #define PHYS_WARSOWBUNNY_BACKTOSIDERATIO getstatf(STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO) #define PHYS_WARSOWBUNNY_AIRFORWARDACCEL getstatf(STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL) #define PHYS_WARSOWBUNNY_TOPSPEED getstatf(STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED) #define PHYS_WARSOWBUNNY_TURNACCEL getstatf(STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL) #define PHYS_JETPACK_ACCEL_UP getstatf(STAT_JETPACK_ACCEL_UP) #define PHYS_JETPACK_ACCEL_SIDE getstatf(STAT_JETPACK_ACCEL_SIDE) #define PHYS_JETPACK_ANTIGRAVITY getstatf(STAT_JETPACK_ANTIGRAVITY) #define PHYS_JETPACK_FUEL getstatf(STAT_JETPACK_FUEL) #define PHYS_JETPACK_MAXSPEED_UP getstatf(STAT_JETPACK_MAXSPEED_UP) #define PHYS_JETPACK_MAXSPEED_SIDE getstatf(STAT_JETPACK_MAXSPEED_SIDE) #define PHYS_DODGING_FROZEN getstati(STAT_DODGING_FROZEN) #elif defined(SVQC) #define PHYS_INPUT_ANGLES(s) s.v_angle #define PHYS_WORLD_ANGLES(s) s.angles #define PHYS_INPUT_TIMELENGTH frametime #define PHYS_INPUT_MOVEVALUES(s) s.movement // TODO: cache #define PHYS_INPUT_BUTTON_MASK(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)) #define PHYS_INPUT_BUTTON_ATCK(s) s.BUTTON_ATCK #define PHYS_INPUT_BUTTON_JUMP(s) s.BUTTON_JUMP #define PHYS_INPUT_BUTTON_ATCK2(s) s.BUTTON_ATCK2 #define PHYS_INPUT_BUTTON_ZOOM(s) s.BUTTON_ZOOM #define PHYS_INPUT_BUTTON_CROUCH(s) s.BUTTON_CROUCH #define PHYS_INPUT_BUTTON_HOOK(s) s.BUTTON_HOOK #define PHYS_INPUT_BUTTON_USE(s) s.BUTTON_USE #define PHYS_INPUT_BUTTON_BACKWARD(s) (s.movement_x < 0) #define PHYS_INPUT_BUTTON_FORWARD(s) (s.movement_x > 0) #define PHYS_INPUT_BUTTON_LEFT(s) (s.movement_y < 0) #define PHYS_INPUT_BUTTON_RIGHT(s) (s.movement_y > 0) #define PHYS_DEAD(s) s.deadflag != DEAD_NO #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE autocvar_sv_gameplayfix_gravityunaffectedbyticrate #define GAMEPLAYFIX_NOGRAVITYONGROUND cvar("sv_gameplayfix_nogravityonground") #define GAMEPLAYFIX_Q2AIRACCELERATE autocvar_sv_gameplayfix_q2airaccelerate #define IS_DUCKED(s) s.crouch #define SET_DUCKED(s) s.crouch = TRUE #define UNSET_DUCKED(s) s.crouch = FALSE #define IS_JUMP_HELD(s) !(s.flags & FL_JUMPRELEASED) #define SET_JUMP_HELD(s) s.flags &= ~FL_JUMPRELEASED #define UNSET_JUMP_HELD(s) s.flags |= FL_JUMPRELEASED #define IS_ONGROUND(s) (s.flags & FL_ONGROUND) #define SET_ONGROUND(s) s.flags |= FL_ONGROUND #define UNSET_ONGROUND(s) s.flags &= ~FL_ONGROUND #define ITEMS(s) s.items #define PHYS_AMMO_FUEL(s) s.ammo_fuel #define PHYS_FROZEN(s) s.frozen #define PHYS_DOUBLEJUMP autocvar_sv_doublejump #define PHYS_JUMPSPEEDCAP_MIN autocvar_sv_jumpspeedcap_min #define PHYS_JUMPSPEEDCAP_MAX autocvar_sv_jumpspeedcap_max #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS autocvar_sv_jumpspeedcap_max_disable_on_ramps #define PHYS_TRACK_CANJUMP(s) s.cvar_cl_movement_track_canjump #define PHYS_ACCELERATE autocvar_sv_accelerate #define PHYS_AIRACCEL_QW(s) s.stat_sv_airaccel_qw #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s) autocvar_sv_airaccel_qw_stretchfactor #define PHYS_AIRACCEL_SIDEWAYS_FRICTION autocvar_sv_airaccel_sideways_friction #define PHYS_AIRACCELERATE autocvar_sv_airaccelerate #define PHYS_AIRCONTROL autocvar_sv_aircontrol #define PHYS_AIRCONTROL_PENALTY autocvar_sv_aircontrol_penalty #define PHYS_AIRCONTROL_POWER autocvar_sv_aircontrol_power #define PHYS_AIRSPEEDLIMIT_NONQW(s) s.stat_sv_airspeedlimit_nonqw #define PHYS_AIRSTOPACCELERATE autocvar_sv_airstopaccelerate #define PHYS_AIRSTRAFEACCEL_QW(s) s.stat_sv_airstrafeaccel_qw #define PHYS_AIRSTRAFEACCELERATE autocvar_sv_airstrafeaccelerate #define PHYS_ENTGRAVITY(s) s.gravity #define PHYS_FRICTION autocvar_sv_friction #define PHYS_GRAVITY autocvar_sv_gravity #define PHYS_HIGHSPEED autocvar_g_movement_highspeed #define PHYS_JUMPVELOCITY autocvar_sv_jumpvelocity #define PHYS_MAXAIRSPEED autocvar_sv_maxairspeed #define PHYS_MAXAIRSTRAFESPEED autocvar_sv_maxairstrafespeed #define PHYS_MAXSPEED(s) s.stat_sv_maxspeed #define PHYS_STEPHEIGHT autocvar_sv_stepheight #define PHYS_STOPSPEED autocvar_sv_stopspeed #define PHYS_WARSOWBUNNY_ACCEL autocvar_sv_warsowbunny_accel #define PHYS_WARSOWBUNNY_BACKTOSIDERATIO autocvar_sv_warsowbunny_backtosideratio #define PHYS_WARSOWBUNNY_AIRFORWARDACCEL autocvar_sv_warsowbunny_airforwardaccel #define PHYS_WARSOWBUNNY_TOPSPEED autocvar_sv_warsowbunny_topspeed #define PHYS_WARSOWBUNNY_TURNACCEL autocvar_sv_warsowbunny_turnaccel #define PHYS_JETPACK_ACCEL_UP autocvar_g_jetpack_acceleration_up #define PHYS_JETPACK_ACCEL_SIDE autocvar_g_jetpack_acceleration_side #define PHYS_JETPACK_ANTIGRAVITY autocvar_g_jetpack_antigravity #define PHYS_JETPACK_FUEL autocvar_g_jetpack_fuel #define PHYS_JETPACK_MAXSPEED_UP autocvar_g_jetpack_maxspeed_up #define PHYS_JETPACK_MAXSPEED_SIDE autocvar_g_jetpack_maxspeed_side #define PHYS_DODGING_FROZEN autocvar_sv_dodging_frozen #endif