| 518 | } |
| 519 | |
| 520 | void PlayerController::onUpdateByInput(float deltaTime) |
| 521 | { |
| 522 | ModelVisual* model = getModelVisual(); |
| 523 | |
| 524 | if (!model) |
| 525 | return; |
| 526 | |
| 527 | if (m_World.getDialogManager().isDialogActive()) |
| 528 | return; |
| 529 | |
| 530 | if (m_World.getEngine()->getHud().isMenuActive()) |
| 531 | resetKeyStates(); |
| 532 | |
| 533 | // Stand up if wounded |
| 534 | if (getModelVisual()->isAnimPlaying("S_WOUNDEDB") && getBodyState() == EBodyState::BS_UNCONSCIOUS) |
| 535 | { |
| 536 | // Only stand up if the unconscious-state has ended (aka. is not valid anymore) |
| 537 | // Otherwise, the player would fall down immediately |
| 538 | if (m_AIStateMachine.isStateActive()) |
| 539 | { |
| 540 | // FIXME: End UNCONSCIOUS-state here |
| 541 | |
| 542 | getEM().onMessage(EventMessages::ConversationMessage::playAnimation("T_WOUNDEDB_2_STAND")); |
| 543 | setBodyState(EBodyState::BS_STAND); |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | if (!getEM().isEmpty() || getUsedMob().isValid()) |
| 548 | return; |
| 549 | |
| 550 | // TODO: HACK, take this out! |
| 551 | float moveMod = 1.0f; |
| 552 | if (m_MoveSpeed1) |
| 553 | moveMod *= 4.0f; |
| 554 | |
| 555 | if (m_MoveSpeed2) |
| 556 | moveMod *= 16.0f; |
| 557 | |
| 558 | m_MoveSpeed2 = false; |
| 559 | m_MoveSpeed1 = false; |
| 560 | |
| 561 | getModelVisual()->getAnimationHandler().setSpeedMultiplier(moveMod); |
| 562 | |
| 563 | m_AIHandler.playerUpdate(deltaTime); |
| 564 | } |
| 565 | |
| 566 | void PlayerController::onMessage(SharedEMessage message, Handle::EntityHandle sourceVob) |
| 567 | { |
no test coverage detected