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

Method addEntity

source/game/StarWorldServer.cpp:756–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754}
755
756void WorldServer::addEntity(EntityPtr const& entity, EntityId entityId) {
757 if (!entity)
758 return;
759
760 entity->init(this, m_entityMap->reserveEntityId(entityId), EntityMode::Master);
761 m_entityMap->addEntity(entity);
762
763 if (auto tileEntity = as<TileEntity>(entity))
764 updateTileEntityTiles(tileEntity);
765}
766
767EntityPtr WorldServer::closestEntity(Vec2F const& center, float radius, EntityFilter selector) const {
768 return m_entityMap->closestEntity(center, radius, selector);

Callers 1

handleIncomingPacketsMethod · 0.45

Calls 2

reserveEntityIdMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected