AIPerception 'Max Age' broken or not implemented correctly while setting up senses in editor

I have been tinkering with the new perception system. However for example when setting up the ‘AI Hearing Config’ in the editor the ‘Max Age’ variable does not seem to be used. When the hearing perception is triggered it will never be forgotten even if Max Age is set to something other then 0.
I have made some changes to the source to remedy this, however I’m not sure if there is a better way.

Firstly in the AIPerceptionTypes.h I added a new argument to the FAIStimulus constructor:


FAIStimulus(const UAISenseConfig& Config, const UAISense& Sense, float StimulusStrength, const FVector& InStimulusLocation, const FVector& InReceiverLocation, FResult Result = SensingSucceeded);

And in AIPerceptionTypes.cpp changed the constructor to:


FAIStimulus::FAIStimulus(const UAISenseConfig& Config, const UAISense& Sense, float StimulusStrength, const FVector& InStimulusLocation, const FVector& InReceiverLocation, FResult Result)
: Age(0.f)
, Strength(Result == SensingSucceeded ? StimulusStrength : -1.f)
, StimulusLocation(InStimulusLocation)
, ReceiverLocation(InReceiverLocation)
, bWantsToNotifyOnlyOnValueChange(Sense.WantsUpdateOnlyOnPerceptionValueChange())
, bSuccessfullySensed(Result == SensingSucceeded)
, bExpired(false)
, ExpirationAge(Config.GetMaxAge() > 0 ? Config.GetMaxAge() : Sense.GetDefaultExpirationAge())
, Type(Sense.GetSenseID())
{}

This is because ExpirationAge was always set to Sense.GetDefaultExpirationAge() ie. FLT_MAX

Now when each stimulus is registered in AISense_Damage.cpp, AISense_Hearing.cpp etc. I pass the FAIStimulus(*Listener.Listener->GetSenseConfig(GetSenseID()) argument to the Listener.RegisterStimulus method.

This seems to work well, however I’m wondering if this will be officially fixed/implemented.

Regards Seb.