You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added missing check for zero-length array.
[CL 2298441 by Richard Hinckley in Main branch]
This commit is contained in:
committed by
UnrealBot
parent
1349608f29
commit
717da5bd35
@@ -86,20 +86,23 @@ FGameplayAbilityTargetDataHandle FGameplayAbilityTargetingLocationInfo::MakeTarg
|
||||
ReturnData->SourceLocation = *this;
|
||||
if (OneActorPerHandle)
|
||||
{
|
||||
if (TargetActors[0].IsValid())
|
||||
if (TargetActors.Num() > 0)
|
||||
{
|
||||
ReturnData->TargetActorArray.Add(TargetActors[0].Get());
|
||||
}
|
||||
|
||||
for (int32 i = 1; i < TargetActors.Num(); ++i)
|
||||
{
|
||||
if (TargetActors[i].IsValid())
|
||||
if (TargetActors[0].IsValid())
|
||||
{
|
||||
FGameplayAbilityTargetData_ActorArray* CurrentData = new FGameplayAbilityTargetData_ActorArray();
|
||||
FGameplayAbilityTargetDataHandle CurrentDataHandle = FGameplayAbilityTargetDataHandle(CurrentData);
|
||||
CurrentData->SourceLocation = *this;
|
||||
CurrentData->TargetActorArray.Add(TargetActors[i].Get());
|
||||
ReturnDataHandle.Append(&CurrentDataHandle);
|
||||
ReturnData->TargetActorArray.Add(TargetActors[0].Get());
|
||||
}
|
||||
|
||||
for (int32 i = 1; i < TargetActors.Num(); ++i)
|
||||
{
|
||||
if (TargetActors[i].IsValid())
|
||||
{
|
||||
FGameplayAbilityTargetData_ActorArray* CurrentData = new FGameplayAbilityTargetData_ActorArray();
|
||||
FGameplayAbilityTargetDataHandle CurrentDataHandle = FGameplayAbilityTargetDataHandle(CurrentData);
|
||||
CurrentData->SourceLocation = *this;
|
||||
CurrentData->TargetActorArray.Add(TargetActors[i].Get());
|
||||
ReturnDataHandle.Append(&CurrentDataHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user