Updated StatusSystem Struct for Bool Comparisons

This commit is contained in:
Philip W 2023-02-23 01:05:27 +00:00
parent 31a6a5d98e
commit c880eb27ac
2 changed files with 6 additions and 1 deletions

View File

@ -34,7 +34,7 @@ void UStatusSystem::TickComponent(float DeltaTime, ELevelTick TickType, FActorCo
{ {
if (StatusEffect.TimeTillExpiry > UGameplayStatics::GetRealTimeSeconds(GetWorld())) if (StatusEffect.TimeTillExpiry > UGameplayStatics::GetRealTimeSeconds(GetWorld()))
{ {
//ActiveStatusEffects.RemoveAt(ActiveStatusEffects.Find(StatusEffect)); ActiveStatusEffects.Remove(StatusEffect);
} }
} }
} }

View File

@ -19,6 +19,11 @@ struct FActiveStatusEffect
UPROPERTY() UPROPERTY()
UStatusEffect* StatusEffect; UStatusEffect* StatusEffect;
bool operator==(const FActiveStatusEffect& Comp) const
{
return StatusEffect == Comp.StatusEffect;
}
}; };
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )