Implemented jump in slide
Signed-off-by: TjgL <lithmoneo@gmail.com>
This commit is contained in:
parent
4cb72bb499
commit
715dcf5a91
@ -265,3 +265,9 @@ void ULMMovementComponent::CrouchToggle(bool Toggle)
|
|||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
bool ULMMovementComponent::CanAttemptJump() const
|
||||||
|
{
|
||||||
|
return IsJumpAllowed() &&
|
||||||
|
(IsMovingOnGround() || IsFalling()); // Falling included for double-jump and non-zero jump hold time, but validated by character.
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,11 @@ int ALMPlayer::RemoveAmmo(const EAmmoType AmmoType, const int Count) const
|
|||||||
return WeaponManager->RemoveAmmo(AmmoType, Count);
|
return WeaponManager->RemoveAmmo(AmmoType, Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ALMPlayer::CanJumpInternal_Implementation() const
|
||||||
|
{
|
||||||
|
return JumpIsAllowedInternal();
|
||||||
|
}
|
||||||
|
|
||||||
void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager)
|
void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager)
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Set weapon manager"))
|
UE_LOG(LogTemp, Warning, TEXT("Set weapon manager"))
|
||||||
|
@ -93,4 +93,5 @@ private:
|
|||||||
void ExitSlide();
|
void ExitSlide();
|
||||||
void PhysSlide(float DeltaTime, int32 Iterations);
|
void PhysSlide(float DeltaTime, int32 Iterations);
|
||||||
bool GetSlideSurface(FHitResult& Hit) const;
|
bool GetSlideSurface(FHitResult& Hit) const;
|
||||||
|
virtual bool CanAttemptJump() const override;
|
||||||
};
|
};
|
||||||
|
@ -53,6 +53,8 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
int RemoveAmmo(EAmmoType AmmoType, int Count) const;
|
int RemoveAmmo(EAmmoType AmmoType, int Count) const;
|
||||||
|
|
||||||
|
virtual bool CanJumpInternal_Implementation() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
Reference in New Issue
Block a user