MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ai_decrease_awareness

Function ai_decrease_awareness

Descent3/AImain.cpp:5584–5608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5582}
5583
5584static inline void ai_decrease_awareness(object *obj) {
5585 ai_frame *ai_info = obj->ai_info;
5586
5587 if (ai_info->awareness == AWARE_NONE && !(ai_info->flags & AIF_PERSISTANT)) {
5588#ifdef _DEBUG
5589 if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) {
5590 mprintf(0, "AI Note: In free path\n");
5591 }
5592#endif
5593 AIPathFreePath(&ai_info->path);
5594 }
5595
5596 if (Gametime - ai_info->last_render_time < AWARENESS_RENDER_RECENTLY_INTERVAL ||
5597 Gametime - ai_info->last_see_target_time < AWARENESS_SEE_TARGET_RECENTLY_INTERVAL ||
5598 Gametime - ai_info->last_hear_target_time < AWARENESS_SEE_TARGET_RECENTLY_INTERVAL)
5599 ai_info->awareness -= (AWARE_RENDER_RECENTLY_FALLOFF * Frametime);
5600 else
5601 ai_info->awareness -= (AWARE_FALLOFF * Frametime);
5602
5603 if (ai_info->awareness < AWARE_NONE) {
5604 ai_info->awareness = AWARE_NONE;
5605 }
5606
5607 // mprintf(0, "Awareness %f", ai_info->awareness);
5608}
5609
5610static inline bool ai_do_script_stuff(object *obj) {
5611 tOSIRISEventInfo ei;

Callers 1

AIDoFrameFunction · 0.85

Calls 1

AIPathFreePathFunction · 0.85

Tested by

no test coverage detected