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

Method destroy

source/game/StarPlayer.cpp:564–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562}
563
564void Player::destroy(RenderCallback* renderCallback) {
565 m_state = State::Idle;
566 m_emoteState = HumanoidEmote::Idle;
567 if (renderCallback) {
568 List<Particle> deathParticles = m_humanoid->particles(m_humanoid->defaultDeathParticles());
569 renderCallback->addParticles(deathParticles, position());
570 }
571
572 if (isMaster()) {
573 m_log->addDeathCount(1);
574
575 if (!world()->disableDeathDrops()) {
576 if (auto dropString = modeConfig().deathDropItemTypes.maybeLeft()) {
577 if (*dropString == "all")
578 dropEverything();
579 } else {
580 List<ItemType> dropList = modeConfig().deathDropItemTypes.right().transformed([](String typeName) {
581 return ItemTypeNames.getLeft(typeName);
582 });
583 Set<ItemType> dropSet = Set<ItemType>::from(dropList);
584 auto itemDb = Root::singleton().itemDatabase();
585 dropSelectedItems([dropSet, itemDb](ItemPtr item) {
586 return dropSet.contains(itemDb->itemType(item->name()));
587 });
588 }
589 }
590 }
591
592 m_songbook->stop();
593}
594
595Maybe<EntityAnchorState> Player::loungingIn() const {
596 if (is<LoungeAnchor>(m_movementController->entityAnchor()))

Callers

nothing calls this directly

Calls 14

singletonClass · 0.85
defaultDeathParticlesMethod · 0.80
addDeathCountMethod · 0.80
rightMethod · 0.80
itemDatabaseMethod · 0.80
particlesMethod · 0.45
addParticlesMethod · 0.45
disableDeathDropsMethod · 0.45
maybeLeftMethod · 0.45
transformedMethod · 0.45
containsMethod · 0.45
itemTypeMethod · 0.45

Tested by

no test coverage detected