MCPcopy Create free account
hub / github.com/crownengine/crown / destroy_level

Method destroy_level

src/world/world.cpp:894–909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892}
893
894void World::destroy_level(Level &level)
895{
896 script_world::unspawned(*_script_world, level._unit_lookup, level._resource->num_units);
897
898 for (u32 i = 0; i < level._resource->num_units; ++i) {
899 const UnitId unit = level._unit_lookup[i];
900
901 post_unit_destroyed_event(unit);
902 _unit_manager->destroy(unit);
903 }
904
905 remove_dead_units();
906
907 list::remove(level._node);
908 level::destroy(*_allocator, &level);
909}
910
911void World::remove_dead_units()
912{

Callers

nothing calls this directly

Calls 4

unspawnedFunction · 0.85
removeFunction · 0.70
destroyFunction · 0.70
destroyMethod · 0.45

Tested by

no test coverage detected