diff --git a/feely_pona.cpp b/feely_pona.cpp index 5b79e2d..fc14c3e 100644 --- a/feely_pona.cpp +++ b/feely_pona.cpp @@ -1426,6 +1426,15 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input defender->aggro_slot[aggro_direction] = entity->handle; } } + } else { + if (closest_defender.dist_squared > DQN_SQUARED(aggro_dist_threshold * 2.f)) { + for (FP_SentinelListLink *link = nullptr; FP_SentinelList_Iterate(&entity->waypoints, &link); ) { + FP_GameEntity *maybe_terry = FP_Game_GetEntity(game, link->data.entity); + if (maybe_terry->type == FP_EntityType_Terry) { + link = FP_SentinelList_Erase(&entity->waypoints, link, game->chunk_pool); + } + } + } } }