MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / removeWorld

Method removeWorld

src/engine/GameSession.cpp:127–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void GameSession::removeWorld(Handle::WorldHandle world)
128{
129 if (m_MainWorld.isValid() && m_MainWorld == world)
130 m_MainWorld.invalidate();
131
132 m_Worlds.erase(std::remove(m_Worlds.begin(), m_Worlds.end(), world), m_Worlds.end());
133
134 for (auto it = m_WorldInstances.begin(); it != m_WorldInstances.end(); it++)
135 {
136 if (it->get() == &world.get())
137 {
138 m_WorldInstances.erase(it);
139 break;
140 }
141 }
142 m_Engine.onWorldRemoved(world);
143}
144
145void GameSession::switchToWorld(const std::string& worldFile)
146{

Callers

nothing calls this directly

Calls 7

eraseMethod · 0.80
getMethod · 0.80
onWorldRemovedMethod · 0.80
isValidMethod · 0.45
invalidateMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected