mirror of https://github.com/ddnet/ddnet.git
Merge bae9edd49f
into d265057591
This commit is contained in:
commit
b93cf2f762
|
@ -678,6 +678,20 @@ MACRO_CONFIG_INT(GfxDriverIsBlocked, gfx_driver_is_blocked, 0, 0, 1, CFGFLAG_SAV
|
|||
|
||||
MACRO_CONFIG_INT(ClVideoRecorderFPS, cl_video_recorder_fps, 60, 1, 1000, CFGFLAG_SAVE | CFGFLAG_CLIENT, "At which FPS the videorecorder should record demos.")
|
||||
|
||||
|
||||
MACRO_CONFIG_INT(ClDummyCopyDirection, cl_dummy_copy_direction, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether dummy should copy your direction (requires cl_dummy_copy_moves 1)")
|
||||
MACRO_CONFIG_INT(ClDummyCopyJump, cl_dummy_copy_jump, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether dummy should copy your jump (requires cl_dummy_copy_moves 1)")
|
||||
MACRO_CONFIG_INT(ClDummyCopyFire, cl_dummy_copy_fire, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether dummy should copy your fire (requires cl_dummy_copy_moves 1)")
|
||||
MACRO_CONFIG_INT(ClDummyCopyHook, cl_dummy_copy_hook, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether dummy should copy your hook (requires cl_dummy_copy_moves 1)")
|
||||
MACRO_CONFIG_INT(ClDummyCopyAim, cl_dummy_copy_aim, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether dummy should copy your aim (requires cl_dummy_copy_moves 1)")
|
||||
MACRO_CONFIG_INT(ClDummyCopyWeapon, cl_dummy_copy_weapon, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether dummy should copy your selected weapon (requires cl_dummy_copy_moves 1)")
|
||||
MACRO_CONFIG_INT(ClDummyDirection, cl_dummy_direction, 0, -1, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Set dummy direction -1, 1(requires cl_dummy_extra_control 1)")
|
||||
|
||||
MACRO_CONFIG_INT(ClDummyReset, cl_dummy_reset, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether to always reset dummy input")
|
||||
MACRO_CONFIG_INT(ClDummyResetHook, cl_dummy_reset_hook, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether to always reset dummy hook input")
|
||||
MACRO_CONFIG_INT(ClDummyResetJump, cl_dummy_reset_jump, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether to always reset dummy jump input")
|
||||
MACRO_CONFIG_INT(ClDummyResetFire, cl_dummy_reset_fire, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether to always reset dummy fire input")
|
||||
MACRO_CONFIG_INT(ClDummyResetDirection, cl_dummy_reset_direction, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Whether to always reset dummy direction input")
|
||||
/*
|
||||
* Add config variables for mods below this comment to avoid merge conflicts.
|
||||
*/
|
||||
|
|
|
@ -39,7 +39,7 @@ void CControls::OnReset()
|
|||
void CControls::ResetInput(int Dummy)
|
||||
{
|
||||
m_aLastData[Dummy].m_Direction = 0;
|
||||
//m_aLastData[Dummy].m_Hook = 0;
|
||||
// m_aLastData[Dummy].m_Hook = 0;
|
||||
// simulate releasing the fire button
|
||||
if((m_aLastData[Dummy].m_Fire & 1) != 0)
|
||||
m_aLastData[Dummy].m_Fire++;
|
||||
|
@ -273,40 +273,92 @@ int CControls::SnapInput(int *pData)
|
|||
m_aInputData[g_Config.m_ClDummy].m_TargetY *= m_pClient->m_Camera.m_Zoom;
|
||||
}
|
||||
|
||||
// dummy copy moves
|
||||
if(g_Config.m_ClDummyCopyMoves)
|
||||
{
|
||||
CNetObj_PlayerInput *pDummyInput = &m_pClient->m_DummyInput;
|
||||
pDummyInput->m_Direction = m_aInputData[g_Config.m_ClDummy].m_Direction;
|
||||
pDummyInput->m_Hook = m_aInputData[g_Config.m_ClDummy].m_Hook;
|
||||
pDummyInput->m_Jump = m_aInputData[g_Config.m_ClDummy].m_Jump;
|
||||
pDummyInput->m_PlayerFlags = m_aInputData[g_Config.m_ClDummy].m_PlayerFlags;
|
||||
pDummyInput->m_TargetX = m_aInputData[g_Config.m_ClDummy].m_TargetX;
|
||||
pDummyInput->m_TargetY = m_aInputData[g_Config.m_ClDummy].m_TargetY;
|
||||
pDummyInput->m_WantedWeapon = m_aInputData[g_Config.m_ClDummy].m_WantedWeapon;
|
||||
// Dummy ResetInput
|
||||
if (g_Config.m_ClDummyReset) {
|
||||
CNetObj_PlayerInput *pDummyInput = &m_pClient->m_DummyInput;
|
||||
pDummyInput->m_Direction = 0;
|
||||
pDummyInput->m_Jump = 0;
|
||||
pDummyInput->m_Hook = 0;
|
||||
pDummyInput->m_Fire = 0;
|
||||
m_aInputData[!g_Config.m_ClDummy] = *pDummyInput;
|
||||
g_Config.m_ClDummyReset = 0;
|
||||
}
|
||||
if (g_Config.m_ClDummyResetJump || g_Config.m_ClDummyResetHook ||
|
||||
g_Config.m_ClDummyResetDirection || g_Config.m_ClDummyResetFire) {
|
||||
CNetObj_PlayerInput *pDummyInput = &m_pClient->m_DummyInput;
|
||||
if (g_Config.m_ClDummyResetJump)
|
||||
pDummyInput->m_Jump = 0;
|
||||
if (g_Config.m_ClDummyResetHook)
|
||||
pDummyInput->m_Hook = 0;
|
||||
if (g_Config.m_ClDummyResetDirection)
|
||||
pDummyInput->m_Direction = 0;
|
||||
if (g_Config.m_ClDummyResetFire)
|
||||
pDummyInput->m_Fire = 0;
|
||||
m_aInputData[!g_Config.m_ClDummy] = *pDummyInput;
|
||||
g_Config.m_ClDummyResetJump = 0;
|
||||
g_Config.m_ClDummyResetHook = 0;
|
||||
g_Config.m_ClDummyResetDirection = 0;
|
||||
g_Config.m_ClDummyResetFire = 0;
|
||||
}
|
||||
|
||||
if(!g_Config.m_ClDummyControl)
|
||||
pDummyInput->m_Fire += m_aInputData[g_Config.m_ClDummy].m_Fire - m_aLastData[g_Config.m_ClDummy].m_Fire;
|
||||
// dummy copy moves
|
||||
if (g_Config.m_ClDummyCopyMoves) {
|
||||
CNetObj_PlayerInput *pDummyInput = &m_pClient->m_DummyInput;
|
||||
if (g_Config.m_ClDummyCopyDirection)
|
||||
pDummyInput->m_Direction = m_aInputData[g_Config.m_ClDummy].m_Direction;
|
||||
if (g_Config.m_ClDummyCopyHook)
|
||||
pDummyInput->m_Hook = m_aInputData[g_Config.m_ClDummy].m_Hook;
|
||||
if (g_Config.m_ClDummyCopyJump)
|
||||
pDummyInput->m_Jump = m_aInputData[g_Config.m_ClDummy].m_Jump;
|
||||
pDummyInput->m_PlayerFlags =
|
||||
m_aInputData[g_Config.m_ClDummy].m_PlayerFlags;
|
||||
if (g_Config.m_ClDummyCopyAim) {
|
||||
pDummyInput->m_TargetX = m_aInputData[g_Config.m_ClDummy].m_TargetX;
|
||||
pDummyInput->m_TargetY = m_aInputData[g_Config.m_ClDummy].m_TargetY;
|
||||
}
|
||||
|
||||
pDummyInput->m_NextWeapon += m_aInputData[g_Config.m_ClDummy].m_NextWeapon - m_aLastData[g_Config.m_ClDummy].m_NextWeapon;
|
||||
pDummyInput->m_PrevWeapon += m_aInputData[g_Config.m_ClDummy].m_PrevWeapon - m_aLastData[g_Config.m_ClDummy].m_PrevWeapon;
|
||||
if (g_Config.m_ClDummyCopyWeapon)
|
||||
pDummyInput->m_WantedWeapon =
|
||||
m_aInputData[g_Config.m_ClDummy].m_WantedWeapon;
|
||||
|
||||
m_aInputData[!g_Config.m_ClDummy] = *pDummyInput;
|
||||
}
|
||||
if (g_Config.m_ClDummyCopyFire)
|
||||
pDummyInput->m_Fire += m_aInputData[g_Config.m_ClDummy].m_Fire -
|
||||
m_aLastData[g_Config.m_ClDummy].m_Fire;
|
||||
|
||||
if(g_Config.m_ClDummyControl)
|
||||
{
|
||||
CNetObj_PlayerInput *pDummyInput = &m_pClient->m_DummyInput;
|
||||
pDummyInput->m_Jump = g_Config.m_ClDummyJump;
|
||||
pDummyInput->m_NextWeapon +=
|
||||
m_aInputData[g_Config.m_ClDummy].m_NextWeapon -
|
||||
m_aLastData[g_Config.m_ClDummy].m_NextWeapon;
|
||||
pDummyInput->m_PrevWeapon +=
|
||||
m_aInputData[g_Config.m_ClDummy].m_PrevWeapon -
|
||||
m_aLastData[g_Config.m_ClDummy].m_PrevWeapon;
|
||||
|
||||
if(g_Config.m_ClDummyFire)
|
||||
pDummyInput->m_Fire = g_Config.m_ClDummyFire;
|
||||
else if((pDummyInput->m_Fire & 1) != 0)
|
||||
pDummyInput->m_Fire++;
|
||||
m_aInputData[!g_Config.m_ClDummy] = *pDummyInput;
|
||||
}
|
||||
|
||||
pDummyInput->m_Hook = g_Config.m_ClDummyHook;
|
||||
}
|
||||
// dummy control mode
|
||||
if (g_Config.m_ClDummyControl) {
|
||||
CNetObj_PlayerInput *pDummyInput = &m_pClient->m_DummyInput;
|
||||
CNetObj_PlayerInput *pDummyLastInput = &m_aLastData[!g_Config.m_ClDummy];
|
||||
|
||||
if (g_Config.m_ClDummyFire)
|
||||
pDummyInput->m_Fire = g_Config.m_ClDummyFire;
|
||||
else if ((pDummyInput->m_Fire & 1) != 0)
|
||||
if(!pDummyLastInput->m_Fire)pDummyInput->m_Fire++;
|
||||
|
||||
if (!m_aLastData[!g_Config.m_ClDummy].m_Jump)
|
||||
if(!pDummyLastInput->m_Jump)pDummyInput->m_Jump = g_Config.m_ClDummyJump;
|
||||
|
||||
if (!m_aLastData[!g_Config.m_ClDummy].m_Hook)
|
||||
if(!pDummyLastInput->m_Hook)pDummyInput->m_Hook = g_Config.m_ClDummyHook;
|
||||
|
||||
m_aInputData[!g_Config.m_ClDummy] = *pDummyInput;
|
||||
}
|
||||
|
||||
if (g_Config.m_ClDummyDirection) {
|
||||
CNetObj_PlayerInput *pDummyInput = &m_pClient->m_DummyInput;
|
||||
pDummyInput->m_Direction = g_Config.m_ClDummyDirection;
|
||||
m_aInputData[!g_Config.m_ClDummy] = *pDummyInput;
|
||||
}
|
||||
// stress testing
|
||||
#ifdef CONF_DEBUG
|
||||
if(g_Config.m_DbgStress)
|
||||
|
|
Loading…
Reference in New Issue