MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / clearWorld

Method clearWorld

source/game/StarWorldClient.cpp:1857–1911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1855}
1856
1857void WorldClient::clearWorld() {
1858 if (m_entityMap) {
1859 while (m_entityMap->size() > 0) {
1860 for (auto entityId : m_entityMap->entityIds())
1861 removeEntity(entityId, false);
1862 }
1863 }
1864
1865 waitForLighting();
1866
1867 m_currentStep = 0;
1868 m_currentTime = 0;
1869 m_inWorld = false;
1870 m_clientId.reset();
1871
1872 m_interpolationTracker = InterpolationTracker();
1873
1874 m_masterEntitiesNetVersion.clear();
1875 m_outgoingPackets.clear();
1876
1877 m_pingTime.reset();
1878
1879 m_entityMap.reset();
1880 m_worldTemplate.reset();
1881 m_worldProperties.clear();
1882
1883 m_tileArray.reset();
1884
1885 m_damageManager.reset();
1886
1887 m_particles.reset();
1888
1889 m_sky.reset();
1890
1891 m_currentParallax.reset();
1892 m_nextParallax.reset();
1893 m_parallaxFadeTimer.setDone();
1894
1895 m_clientState.reset();
1896 m_ambientSounds.cancelAll();
1897 m_musicTrack.cancelAll();
1898 m_musicTrack.setVolume(1, 0, 0);
1899 m_altMusicTrack.cancelAll();
1900 m_altMusicTrack.setVolume(0, 0, 0);
1901 m_altMusicActive = false;
1902
1903 if (m_spaceSound) {
1904 m_spaceSound->stop();
1905 m_spaceSound = {};
1906 }
1907
1908 m_entityMessageResponses = {};
1909
1910 m_forceRegions.clear();
1911}
1912
1913void WorldClient::tryGiveMainPlayerItem(ItemPtr item, bool silent) {
1914 if (auto spill = m_mainPlayer->pickupItems(item, silent))

Callers

nothing calls this directly

Calls 9

entityIdsMethod · 0.80
setDoneMethod · 0.80
cancelAllMethod · 0.80
sizeMethod · 0.45
resetMethod · 0.45
clearMethod · 0.45
setVolumeMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected