| 4585 | } |
| 4586 | |
| 4587 | void CGameContext::LoadMapSettings() |
| 4588 | { |
| 4589 | IMap *pMap = Map(); |
| 4590 | int Start, Num; |
| 4591 | pMap->GetType(MAPITEMTYPE_INFO, &Start, &Num); |
| 4592 | for(int i = Start; i < Start + Num; i++) |
| 4593 | { |
| 4594 | int ItemId; |
| 4595 | CMapItemInfoSettings *pItem = (CMapItemInfoSettings *)pMap->GetItem(i, nullptr, &ItemId); |
| 4596 | int ItemSize = pMap->GetItemSize(i); |
| 4597 | if(!pItem || ItemId != 0) |
| 4598 | continue; |
| 4599 | |
| 4600 | if(ItemSize < (int)sizeof(CMapItemInfoSettings)) |
| 4601 | break; |
| 4602 | if(!(pItem->m_Settings > -1)) |
| 4603 | break; |
| 4604 | |
| 4605 | int Size = pMap->GetDataSize(pItem->m_Settings); |
| 4606 | char *pSettings = (char *)pMap->GetData(pItem->m_Settings); |
| 4607 | char *pNext = pSettings; |
| 4608 | while(pNext < pSettings + Size) |
| 4609 | { |
| 4610 | int StrSize = str_length(pNext) + 1; |
| 4611 | Console()->ExecuteLine(pNext, IConsole::CLIENT_ID_GAME); |
| 4612 | pNext += StrSize; |
| 4613 | } |
| 4614 | pMap->UnloadData(pItem->m_Settings); |
| 4615 | break; |
| 4616 | } |
| 4617 | |
| 4618 | char aBuf[IO_MAX_PATH_LENGTH]; |
| 4619 | str_format(aBuf, sizeof(aBuf), "maps/%s.map.cfg", g_Config.m_SvMap); |
| 4620 | Console()->ExecuteFile(aBuf, IConsole::CLIENT_ID_NO_GAME); |
| 4621 | } |
| 4622 | |
| 4623 | void CGameContext::OnSnap(int ClientId, bool GlobalSnap, bool RecordingDemo) |
| 4624 | { |
nothing calls this directly
no test coverage detected