MCPcopy Create free account
hub / github.com/ddnet/ddnet / LoadCurrentMap

Method LoadCurrentMap

src/game/editor/editor.cpp:7440–7456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7438}
7439
7440void CEditor::LoadCurrentMap()
7441{
7442 CGameClient *pGameClient = (CGameClient *)Kernel()->RequestInterface<IGameClient>();
7443
7444 if(Load(pGameClient->Map()->Path(), IStorage::TYPE_SAVE))
7445 {
7446 Map()->m_ValidSaveFilename = !str_startswith(pGameClient->Map()->Path(), "downloadedmaps/");
7447 }
7448 else
7449 {
7450 Load(pGameClient->Map()->Path(), IStorage::TYPE_ALL);
7451 Map()->m_ValidSaveFilename = false;
7452 }
7453
7454 vec2 Center = pGameClient->m_Camera.m_Center;
7455 MapView()->SetWorldOffset(Center);
7456}
7457
7458bool CEditor::Save(const char *pFilename)
7459{

Callers 1

PopupEventMethod · 0.80

Calls 6

MapFunction · 0.85
str_startswithFunction · 0.85
MapViewFunction · 0.85
SetWorldOffsetMethod · 0.80
PathMethod · 0.45
MapMethod · 0.45

Tested by

no test coverage detected