Fix checks
This commit is contained in:
parent
46f2d7b465
commit
d07932771c
@ -42,11 +42,13 @@ void ASwarmAgent::OnSwarmAgentBeginOverlap(UPrimitiveComponent* OverlappedCompon
|
|||||||
|
|
||||||
if (!EnemyHealthComponent->GetIsDead())
|
if (!EnemyHealthComponent->GetIsDead())
|
||||||
{
|
{
|
||||||
if (AVampireCharacter* character = Cast<AVampireCharacter>(GetOwner()))
|
if (AWeapon* ownerWeapon = Cast<AWeapon>(GetOwner()))
|
||||||
{
|
{
|
||||||
AController* ownerController = character->GetController();
|
if (AVampireCharacter* character = Cast<AVampireCharacter>(ownerWeapon->GetOwner()))
|
||||||
AWeapon* ownerWeapon = Cast<AWeapon>(GetOwner());
|
{
|
||||||
EnemyHealthComponent->TakeDamage(Enemy, ownerWeapon->Damage, nullptr, ownerController, this);
|
AController* ownerController = character->GetController();
|
||||||
|
EnemyHealthComponent->TakeDamage(Enemy, ownerWeapon->Damage, nullptr, ownerController, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ void ASwarmWeapon::TimelineCallback(float val)
|
|||||||
FVector Direction = FVector(0.0, 1, 0.0);
|
FVector Direction = FVector(0.0, 1, 0.0);
|
||||||
FVector RotatedDirection = Direction.RotateAngleAxis(val * 360.0f + offset, FVector(0.0f, 0.0f, 1.0f));
|
FVector RotatedDirection = Direction.RotateAngleAxis(val * 360.0f + offset, FVector(0.0f, 0.0f, 1.0f));
|
||||||
FVector NewLocation = CenterLocation + (RotatedDirection * Distance);
|
FVector NewLocation = CenterLocation + (RotatedDirection * Distance);
|
||||||
NewLocation.Z = 140.0f;
|
NewLocation.Z = 190.0f;
|
||||||
SwarmActors[i]->SetActorLocation(NewLocation);
|
SwarmActors[i]->SetActorLocation(NewLocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user