| 115 | void NextMapManager::HookChangeLevel(const char *map, const char *unknown) |
| 116 | #else |
| 117 | void NextMapManager::HookChangeLevel(const char *map, const char *unknown, const char *video, bool bLongLoading) |
| 118 | #endif |
| 119 | { |
| 120 | if (g_forcedChange) |
| 121 | { |
| 122 | logger->LogMessage("[SM] Changed map to \"%s\"", map); |
| 123 | RETURN_META(MRES_IGNORED); |
| 124 | } |
| 125 | |
| 126 | const char *newmap = sm_nextmap.GetString(); |
| 127 | if (newmap[0] != '\0') { |
| 128 | ke::SafeStrcpy(g_nextMap, sizeof(g_nextMap), newmap); |
| 129 | newmap = g_nextMap; |
| 130 | |
| 131 | // Clear the value so that if the map load fails later we don't get stuck in a loop. |
| 132 | // This might cause us to go off-cycle for a map, but nextmap will get us back on track. |
| 133 | sm_nextmap.SetValue(""); |
| 134 | } |
| 135 | |
| 136 | if (newmap[0] == '\0' || !g_HL2.IsMapValid(newmap)) |
| 137 | { |
| 138 | RETURN_META(MRES_IGNORED); |
| 139 | } |
| 140 | |
| 141 | logger->LogMessage("[SM] Changed map to \"%s\"", newmap); |
| 142 | |
| 143 | ke::SafeStrcpy(m_tempChangeInfo.m_mapName, sizeof(m_tempChangeInfo.m_mapName), newmap); |
| 144 | ke::SafeStrcpy(m_tempChangeInfo.m_changeReason, sizeof(m_tempChangeInfo.m_changeReason), "Normal level change"); |
| 145 | |
| 146 | #if SOURCE_ENGINE != SE_DARKMESSIAH |
| 147 | RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::ChangeLevel, (newmap, unknown)); |
| 148 | #else |
| 149 | RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::ChangeLevel, (newmap, unknown, video, bLongLoading)); |
| 150 | #endif |
| 151 | } |
| 152 | |
| 153 | void NextMapManager::OnSourceModLevelChange( const char *mapName ) |
| 154 | { |
nothing calls this directly
no test coverage detected