mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Only reload map afer saving in editor if we're on localhost
This commit is contained in:
parent
6997a801bc
commit
4f6e2eb11f
|
@ -450,10 +450,18 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
|
|||
{
|
||||
CServerInfo CurrentServerInfo;
|
||||
m_pEditor->Client()->GetServerInfo(&CurrentServerInfo);
|
||||
char aMapName[128];
|
||||
m_pEditor->ExtractName(pFileName, aMapName, sizeof(aMapName));
|
||||
if(!str_comp(aMapName, CurrentServerInfo.m_aMap))
|
||||
m_pEditor->Client()->Rcon("reload");
|
||||
const unsigned char ipv4Localhost[16] = {127,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
const unsigned char ipv6Localhost[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
|
||||
|
||||
// and if we're on localhost
|
||||
if(!mem_comp(CurrentServerInfo.m_NetAddr.ip, ipv4Localhost, sizeof(ipv4Localhost))
|
||||
|| !mem_comp(CurrentServerInfo.m_NetAddr.ip, ipv6Localhost, sizeof(ipv6Localhost)))
|
||||
{
|
||||
char aMapName[128];
|
||||
m_pEditor->ExtractName(pFileName, aMapName, sizeof(aMapName));
|
||||
if(!str_comp(aMapName, CurrentServerInfo.m_aMap))
|
||||
m_pEditor->Client()->Rcon("reload");
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue