mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #5125
5125: Fix server loading map twice on startup r=def- a=Zwelf Fixes creating two teehistorian files. And probably increases performance :). Fixes #5121 ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Zwelf <zwelf@strct.cc>
This commit is contained in:
commit
450e6a53f7
|
@ -2383,6 +2383,8 @@ void CServer::ChangeMap(const char *pMap)
|
|||
|
||||
int CServer::LoadMap(const char *pMapName)
|
||||
{
|
||||
m_MapReload = false;
|
||||
|
||||
char aBuf[IO_MAX_PATH_LENGTH];
|
||||
str_format(aBuf, sizeof(aBuf), "maps/%s.map", pMapName);
|
||||
GameServer()->OnMapChange(aBuf, sizeof(aBuf));
|
||||
|
@ -2602,8 +2604,6 @@ int CServer::Run()
|
|||
// load new map TODO: don't poll this
|
||||
if(m_MapReload)
|
||||
{
|
||||
m_MapReload = false;
|
||||
|
||||
// load map
|
||||
if(LoadMap(Config()->m_SvMap))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue