From 747d972d389ab39ad712a766b9ca5e0598f87b21 Mon Sep 17 00:00:00 2001 From: Choupom Date: Sat, 5 Jun 2010 10:44:50 +0200 Subject: fixed so we can run a map which is in a folder --- src/engine/server/server.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/engine') diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 6dd5a959..96071ceb 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -552,8 +552,16 @@ int CServer::DelClientCallback(int ClientId, void *pUser) void CServer::SendMap(int ClientId) { + //get the name of the map without his path + char * pMapShortName = &g_Config.m_SvMap[0]; + for(int i = 0; i < 128; i++) + { + if(g_Config.m_SvMap[i] == '/' || g_Config.m_SvMap[i] == '\\' && i+1 < 128) + pMapShortName = &g_Config.m_SvMap[i+1]; + } + CMsgPacker Msg(NETMSG_MAP_CHANGE); - Msg.AddString(g_Config.m_SvMap, 0); + Msg.AddString(pMapShortName, 0); Msg.AddInt(m_CurrentMapCrc); SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientId, true); } -- cgit 1.4.1 From 442e6e14315350bb52646191c27ef20d88e3e8fc Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 6 Jun 2010 14:31:16 +0200 Subject: fixed issue when using +commands in the console --- src/engine/shared/console.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/engine') diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index c545b7db..eacf9b78 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -273,7 +273,8 @@ CConsole::CCommand *CConsole::FindCommand(const char *pName) void CConsole::ExecuteLine(const char *pStr) { - CConsole::ExecuteLineStroked(1, pStr); + CConsole::ExecuteLineStroked(1, pStr); // press it + CConsole::ExecuteLineStroked(0, pStr); // then release it } -- cgit 1.4.1 From a41d930a85f31064965d89115d851518d568f175 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 5 Jun 2010 13:38:08 +0200 Subject: fixed some compiler warnings. Closes #76 --- src/engine/external/pnglite/pnglite.h | 2 +- src/game/client/components/console.cpp | 14 +++++++++++--- src/game/client/components/console.h | 3 ++- src/game/server/entities/character.h | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src/engine') diff --git a/src/engine/external/pnglite/pnglite.h b/src/engine/external/pnglite/pnglite.h index 72ff1c52..eae3d4ce 100644 --- a/src/engine/external/pnglite/pnglite.h +++ b/src/engine/external/pnglite/pnglite.h @@ -73,7 +73,7 @@ enum typedef unsigned (*png_write_callback_t)(void* input, unsigned long size, unsigned long numel, void* user_pointer); typedef unsigned (*png_read_callback_t)(void* output, unsigned long size, unsigned long numel, void* user_pointer); typedef void (*png_free_t)(void* p); -typedef void * (*png_alloc_t)(unsigned long s); +typedef void * (*png_alloc_t)(size_t s); typedef struct { diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index 742b6b2d..b323ab48 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -34,9 +34,8 @@ enum CONSOLE_CLOSING, }; -CGameConsole::CInstance::CInstance(CGameConsole *pGameConsole, int Type) +CGameConsole::CInstance::CInstance(int Type) { - m_pGameConsole = pGameConsole; // init ringbuffers //history = ringbuf_init(history_data, sizeof(history_data), RINGBUF_FLAG_RECYCLE); //backlog = ringbuf_init(backlog_data, sizeof(backlog_data), RINGBUF_FLAG_RECYCLE); @@ -56,6 +55,11 @@ CGameConsole::CInstance::CInstance(CGameConsole *pGameConsole, int Type) m_pCommand = 0x0; } +void CGameConsole::CInstance::Init(CGameConsole *pGameConsole) +{ + m_pGameConsole = pGameConsole; +}; + void CGameConsole::CInstance::ExecuteLine(const char *pLine) { if(m_Type == 0) @@ -198,7 +202,7 @@ void CGameConsole::CInstance::PrintLine(const char *pLine) } CGameConsole::CGameConsole() -: m_LocalConsole(this, 0), m_RemoteConsole(this, 1) +: m_LocalConsole(0), m_RemoteConsole(1) { m_ConsoleType = 0; m_ConsoleState = CONSOLE_CLOSED; @@ -573,6 +577,10 @@ void CGameConsole::PrintLine(int Type, const char *pLine) void CGameConsole::OnConsoleInit() { + // init console instances + m_LocalConsole.Init(this); + m_RemoteConsole.Init(this); + m_pConsole = Kernel()->RequestInterface(); // diff --git a/src/game/client/components/console.h b/src/game/client/components/console.h index b88c6349..d146307f 100644 --- a/src/game/client/components/console.h +++ b/src/game/client/components/console.h @@ -27,7 +27,8 @@ class CGameConsole : public CComponent IConsole::CCommandInfo *m_pCommand; - CInstance(CGameConsole *pGameConsole, int t); + CInstance(int t); + void Init(CGameConsole *pGameConsole); void ExecuteLine(const char *pLine); diff --git a/src/game/server/entities/character.h b/src/game/server/entities/character.h index a1add982..bea0c002 100644 --- a/src/game/server/entities/character.h +++ b/src/game/server/entities/character.h @@ -57,7 +57,7 @@ public: void SetEmote(int Emote, int Tick); - const bool IsAlive() { return m_Alive; } + bool IsAlive() const { return m_Alive; } class CPlayer *GetPlayer() { return m_pPlayer; } private: -- cgit 1.4.1