about summary refs log tree commit diff
path: root/src/engine/server
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2010-06-05 10:44:50 +0200
committerChoupom <andycootlapin@hotmail.fr>2010-06-05 10:44:50 +0200
commit747d972d389ab39ad712a766b9ca5e0598f87b21 (patch)
tree487e5d6f5ec24f17b34404773d83cc079f960e4d /src/engine/server
parent848764544faad43ec27dcd60579637aca3d52004 (diff)
downloadzcatch-747d972d389ab39ad712a766b9ca5e0598f87b21.tar.gz
zcatch-747d972d389ab39ad712a766b9ca5e0598f87b21.zip
fixed so we can run a map which is in a folder
Diffstat (limited to 'src/engine/server')
-rw-r--r--src/engine/server/server.cpp10
1 files changed, 9 insertions, 1 deletions
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);
 }