Bugfix Player Getting Damaged Once Boss was Dead

This commit is contained in:
Philip W 2023-05-22 17:12:08 +01:00
parent 4bba8fc1eb
commit ccb50a804e

View File

@ -62,7 +62,7 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot)
PlayerActor->CallFunctionByNameWithArguments(*Command, AR, nullptr, true);
const FString Command69 = FString::Printf(TEXT("CloseEscapeMenu"));
PlayerActor->CallFunctionByNameWithArguments(*Command69, AR, nullptr, true);
//Disable Character Movement
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
PlayerController->SetIgnoreMoveInput(true);
@ -112,7 +112,7 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot)
void ATurnBaseCombatV2::CombatCheck(const bool bWasShot)
{
const UBlackboardComponent* EnemyBlackboard = Cast<AAIController>(EnemyActor->GetInstigatorController())->GetBlackboardComponent();
ChainDamageMultiplier = 0;
BaseDamageMultiplier = DefaultBaseDamageMultiplier;
EnemyBaseDamageMultiplier = DefaultEnemyBaseDamageMultiplier;
@ -415,6 +415,9 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo)
if (!bPlayerHasExtraTurn)
{
FProperty* IsBossProperty = FindFieldChecked<FProperty>(EnemyActor->GetClass(), "IsBoss");
const FBoolProperty* IsBossBoolProperty = CastFieldChecked<FBoolProperty>(IsBossProperty);
if (IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor) && EnemyHealth <= nullptr) return;
SwitchTurn();
}
else