58{
59 AIPerception::FListenerMap& ListenersMap = *GetListeners();
60
61
62 for (AIPerception::FListenerMap::TIterator ListenerIt(ListenersMap); ListenerIt; ++ListenerIt)
63 {
64
65 FPerceptionListener& Listener = ListenerIt->Value;
66
67
68
69 if(Listener.HasSense(GetSenseID()) == false){continue;}
71
74 {
75 const FVector::FReal DistToActionSquared = FVector::DistSquared(Event.GetBroadcastLocation(), Listener.CachedLocation);
76
77 const float ClampedMultiplier = FMath::Max(0.1f, Event.RangeMultiplier);
78 const bool bOutOfListeningRange = (DistToActionSquared > (FMath::Square(ListenersConfig.ActionRadius) * ClampedMultiplier));
79
80 if(FAISenseAffiliationFilter::ShouldSenseTeam(Listener.TeamIdentifier, Event.TeamIdentifier, ListenersConfig.AffiliationFlags) == false)
81 {
82 continue;
83 }
84 if(bOutOfListeningRange)
85 {
86 continue;
87 }
88
89
90
91
92
93 if(Listener.GetBodyActor()->GetInstigatorController() == Event.Broadcaster)
94 {
95 continue;
96 }
97 Listener.RegisterStimulus(Event.OtherActor, FAIStimulus(*
this, Event.Strength, Event.Location, Event.GetBroadcastLocation(), FAIStimulus::SensingSucceeded,
UAIBPLib::GetActionTagFromType(Event.Action)).SetStimulusAge(Event.InformationAge));
98
99
100
101
102
103
104
105 }
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144 }
146 return SuspendNextUpdate;
147
148
149
150}
static FName GetActionTagFromType(const EAIActionType ActionType)
Definition AIBPLib.cpp:216
const FDigestedActionProperties * GetActionConfigByListenerID(const FPerceptionListenerID &TargetID)
Definition AISense_Actions.cpp:43