Fixed the stuff in comments

This commit is contained in:
verysecrethero
2016-03-03 17:33:41 +01:00
parent f84d1ac4a1
commit c5f3bfc0cd
2 changed files with 8 additions and 19 deletions
@@ -28,9 +28,9 @@ public:
virtual void Reset(); virtual void Reset();
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer); void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer);
bool SniperSprintingCheck();
virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; } virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; }
virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; } virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; }
bool SpecialAbilityKeyDown() const { return m_SpecialAbilityKeyDown; }
protected: protected:
const int m_PlayerID; const int m_PlayerID;
@@ -145,10 +145,10 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
if (m_NumberOfMovementKeysDown == 0) { if (m_NumberOfMovementKeysDown == 0) {
m_MovementKeyDown = false; m_MovementKeyDown = false;
} }
//you have just released the key, store what key it was and reset the doubletap-sensitivity-timer //you have just released the key, store what key it was and reset the doubletap-sensitivity-timer
m_AssaultDashTapDirection = m_CurrentDirectionVector; m_AssaultDashTapDirection = m_CurrentDirectionVector;
m_AssaultDashDoubleTapDeltaTime = 0.f; m_AssaultDashDoubleTapDeltaTime = 0.f;
} }
} }
@@ -161,12 +161,9 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
} }
if (e.Command == "SpecialAbility") { if (e.Command == "SpecialAbility") {
if (e.Value > 0) { m_SpecialAbilityKeyDown = e.Value > 0;
m_SpecialAbilityKeyDown = true;
} else {
m_SpecialAbilityKeyDown = false;
}
} }
if (m_SpecialAbilityKeyDown && m_MovementKeyDown) { if (m_SpecialAbilityKeyDown && m_MovementKeyDown) {
m_ShiftDashing = true; m_ShiftDashing = true;
} else { } else {
@@ -241,12 +238,4 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
m_EventBroker->Publish(e); m_EventBroker->Publish(e);
} }
template <typename EventContext>
bool FirstPersonInputController<EventContext>::SniperSprintingCheck() {
if (m_SpecialAbilityKeyDown) {
return true;
} else {
return false;
}
}
#endif #endif
+1 -1
View File
@@ -68,7 +68,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
} }
bool sniperSprinting = false; bool sniperSprinting = false;
if (player.HasComponent("SprintAbility")) { if (player.HasComponent("SprintAbility")) {
if (controller->SniperSprintingCheck()) { if (controller->SpecialAbilityKeyDown()) {
playerMovementSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"]; playerMovementSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
playerCrouchSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"]; playerCrouchSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
sniperSprinting = true; sniperSprinting = true;