| 833 | } |
| 834 | |
| 835 | void Player::update(float dt, uint64_t) { |
| 836 | m_movementController->setTimestep(dt); |
| 837 | |
| 838 | if (isMaster()) { |
| 839 | if (m_emoteCooldownTimer) { |
| 840 | m_emoteCooldownTimer -= dt; |
| 841 | if (m_emoteCooldownTimer <= 0) { |
| 842 | m_emoteCooldownTimer = 0; |
| 843 | m_emoteState = HumanoidEmote::Idle; |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | if (m_chatMessageUpdated) { |
| 848 | auto state = Root::singleton().emoteProcessor()->detectEmotes(m_chatMessage); |
| 849 | if (state != HumanoidEmote::Idle) |
| 850 | addEmote(state); |
| 851 | m_chatMessageUpdated = false; |
| 852 | } |
| 853 | |
| 854 | m_blinkCooldownTimer -= dt; |
| 855 | if (m_blinkCooldownTimer <= 0) { |
| 856 | m_blinkCooldownTimer = Random::randf(m_blinkInterval[0], m_blinkInterval[1]); |
| 857 | auto loungeAnchor = as<LoungeAnchor>(m_movementController->entityAnchor()); |
| 858 | if (m_emoteState == HumanoidEmote::Idle && (!loungeAnchor || !loungeAnchor->emote)) |
| 859 | addEmote(HumanoidEmote::Blink); |
| 860 | } |
| 861 | |
| 862 | m_lastDamagedOtherTimer += dt; |
| 863 | |
| 864 | if (m_movementController->zeroG()) |
| 865 | m_movementController->controlParameters(m_zeroGMovementParameters); |
| 866 | |
| 867 | if (isTeleporting()) { |
| 868 | m_teleportTimer -= dt; |
| 869 | if (m_teleportTimer <= 0 && m_state == State::TeleportIn) { |
| 870 | m_state = State::Idle; |
| 871 | m_effectsAnimator->burstParticleEmitter(m_teleportAnimationType + "Burst"); |
| 872 | } |
| 873 | } |
| 874 | |
| 875 | if (!isTeleporting()) { |
| 876 | processControls(); |
| 877 | |
| 878 | m_questManager->update(dt); |
| 879 | m_companions->update(dt); |
| 880 | m_deployment->update(dt); |
| 881 | |
| 882 | bool edgeTriggeredUse = take(m_edgeTriggeredUse); |
| 883 | |
| 884 | m_inventory->cleanup(); |
| 885 | refreshEquipment(); |
| 886 | |
| 887 | if (inConflictingLoungeAnchor()) |
| 888 | m_movementController->resetAnchorState(); |
| 889 | |
| 890 | if (m_state == State::Lounge) { |
| 891 | if (auto loungeAnchor = as<LoungeAnchor>(m_movementController->entityAnchor())) { |
| 892 | m_statusController->setPersistentEffects("lounging", loungeAnchor->statusEffects); |
nothing calls this directly
no test coverage detected