Added copy moves function for dummy

This commit is contained in:
Tobii 2015-02-16 11:19:42 +01:00
parent 3d713ca686
commit b309fd41eb
4 changed files with 25 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include "message.h"
#include <engine/shared/config.h>
#include <versionsrv/versionsrv.h>
#include <game/generated/protocol.h>
enum
{
@ -40,6 +41,8 @@ public:
int m_LocalIDs[2];
char m_aNews[NEWS_SIZE];
CNetObj_PlayerInput DummyInput;
class CSnapItem
{
public:

View file

@ -154,7 +154,6 @@ class CClient : public IClient, public CDemoPlayer::IListner
int m_CurrentInput[2];
bool m_LastDummy;
bool m_LastDummy2;
CNetObj_PlayerInput DummyInput;
CNetObj_PlayerInput HammerInput;
// graphs

View file

@ -273,6 +273,27 @@ int CControls::SnapInput(int *pData)
if(!m_InputDirectionLeft[g_Config.m_ClDummy] && m_InputDirectionRight[g_Config.m_ClDummy])
m_InputData[g_Config.m_ClDummy].m_Direction = 1;
// dummy copy moves
if(g_Config.m_ClDummyCopyMoves)
{
CNetObj_PlayerInput *DummyInput = &Client()->DummyInput;
DummyInput->m_Direction = m_InputData[g_Config.m_ClDummy].m_Direction;
DummyInput->m_Hook = m_InputData[g_Config.m_ClDummy].m_Hook;
DummyInput->m_Jump = m_InputData[g_Config.m_ClDummy].m_Jump;
DummyInput->m_PlayerFlags = m_InputData[g_Config.m_ClDummy].m_PlayerFlags;
DummyInput->m_TargetX = m_InputData[g_Config.m_ClDummy].m_TargetX;
DummyInput->m_TargetY = m_InputData[g_Config.m_ClDummy].m_TargetY;
DummyInput->m_WantedWeapon = m_InputData[g_Config.m_ClDummy].m_WantedWeapon;
DummyInput->m_Fire += m_InputData[g_Config.m_ClDummy].m_Fire - m_LastData[g_Config.m_ClDummy].m_Fire;
DummyInput->m_NextWeapon += m_InputData[g_Config.m_ClDummy].m_NextWeapon - m_LastData[g_Config.m_ClDummy].m_NextWeapon;
DummyInput->m_PrevWeapon += m_InputData[g_Config.m_ClDummy].m_PrevWeapon - m_LastData[g_Config.m_ClDummy].m_PrevWeapon;
m_InputData[!g_Config.m_ClDummy] = *DummyInput;
}
// stress testing
if(g_Config.m_DbgStress)
{

View file

@ -101,6 +101,7 @@ MACRO_CONFIG_STR(DummySkin, dummy_skin, 24, "default", CFGFLAG_CLIENT|CFGFLAG_SA
MACRO_CONFIG_INT(ClDummy, cl_dummy, 0, 0, 1, CFGFLAG_CLIENT, "0 - player / 1 - dummy")
MACRO_CONFIG_INT(ClDummyHammer, cl_dummy_hammer, 0, 0, 1, CFGFLAG_CLIENT, "Whether dummy is hammering for a hammerfly")
MACRO_CONFIG_INT(ClDummyResetOnSwitch, cl_dummy_resetonswitch, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether dummy should stop pressing keys when you switch")
MACRO_CONFIG_INT(ClDummyCopyMoves, cl_dummy_copy_moves, 0, 0, 1, CFGFLAG_CLIENT, "Wether dummy should copy your moves")
// server
MACRO_CONFIG_INT(SvWarmup, sv_warmup, 0, 0, 0, CFGFLAG_SERVER, "Number of seconds to do warmup before round starts")