diff --git a/Content/Legumix/Player/BP_Play.uasset b/Content/Legumix/Player/BP_Play.uasset index ac052a8..66fe93a 100644 --- a/Content/Legumix/Player/BP_Play.uasset +++ b/Content/Legumix/Player/BP_Play.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e16bdedf5af4e17588ed3cee89c2d0ebc84501fcd9493ea9562a60965d253f47 -size 941231 +oid sha256:1e6b1fc752ebf056b95ba085f10d2096998fbe47a63e16d15accdd3c3b48f9d6 +size 961689 diff --git a/Source/LegumeMix/Private/Player/LMHealthComponent.cpp b/Source/LegumeMix/Private/Player/LMHealthComponent.cpp index 596a4fc..6a30685 100644 --- a/Source/LegumeMix/Private/Player/LMHealthComponent.cpp +++ b/Source/LegumeMix/Private/Player/LMHealthComponent.cpp @@ -31,6 +31,13 @@ void ULMHealthComponent::RegisterHitBoxes() } } +void ULMHealthComponent::AddHealth(const float AddedHealth, const bool NoLimits) +{ + Health = FMath::Clamp(Health + AddedHealth, 0.0f, NoLimits ? INT_MAX : MaxHealth); + OnHealthChanged.Broadcast(Health, AddedHealth); +} + + void ULMHealthComponent::TakeDamage_Implementation(const float Damage) { if (Damage <= 0.0f) diff --git a/Source/LegumeMix/Private/Player/LMPlayer.cpp b/Source/LegumeMix/Private/Player/LMPlayer.cpp index f08b9eb..50be3c3 100644 --- a/Source/LegumeMix/Private/Player/LMPlayer.cpp +++ b/Source/LegumeMix/Private/Player/LMPlayer.cpp @@ -296,7 +296,7 @@ void ALMPlayer::DoLedgeGrabCheck() if (Results) { FHitResult CapsuleCheck; - float HalfHeight = LegumixMovementComponent->bWantsToCrouch ? LegumixMovementComponent->CrouchedHalfHeight : GetCapsuleComponent()->GetScaledCapsuleHalfHeight(); + float HalfHeight = LegumixMovementComponent->bWantsToCrouch ? LegumixMovementComponent->GetCrouchedHalfHeight() : GetCapsuleComponent()->GetScaledCapsuleHalfHeight(); const FVector Offset = Hit.ImpactPoint + FVector(0, 0, HalfHeight + GetCapsuleComponent()->GetScaledCapsuleRadius()); const bool IsObstructed = UKismetSystemLibrary::CapsuleTraceSingleByProfile(GetWorld(), Offset, Offset, diff --git a/Source/LegumeMix/Public/Player/LMHealthComponent.h b/Source/LegumeMix/Public/Player/LMHealthComponent.h index d6e7d0b..5d18be4 100644 --- a/Source/LegumeMix/Public/Player/LMHealthComponent.h +++ b/Source/LegumeMix/Public/Player/LMHealthComponent.h @@ -71,7 +71,7 @@ public: * @param NoLimits If sets, ignore the component's MaxHealth value. */ UFUNCTION(BlueprintCallable, Category=Legumix, meta=(Keywords = "Refill, Health")) - void AddHealth(const float AddedHealth, const bool NoLimits = false) { Health = FMath::Clamp(Health + AddedHealth, 0.0f, NoLimits ? INT_MAX : MaxHealth); } + void AddHealth(const float AddedHealth, const bool NoLimits = false); /** * Event automatically called when the character receives damages from an attack source.