| 562 | } |
| 563 | |
| 564 | void 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 | |
| 595 | Maybe<EntityAnchorState> Player::loungingIn() const { |
| 596 | if (is<LoungeAnchor>(m_movementController->entityAnchor())) |
nothing calls this directly
no test coverage detected