This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Source/AgrarianGame/Variant_Combat/AI/EnvQueryContext_Player.cpp
T

19 lines
649 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "EnvQueryContext_Player.h"
#include "Kismet/GameplayStatics.h"
#include "EnvironmentQuery/EnvQueryTypes.h"
#include "EnvironmentQuery/Items/EnvQueryItemType_Actor.h"
#include "GameFramework/Pawn.h"
void UEnvQueryContext_Player::ProvideContext(FEnvQueryInstance& QueryInstance, FEnvQueryContextData& ContextData) const
{
// get the player pawn for the first local player
AActor* PlayerPawn = UGameplayStatics::GetPlayerPawn(QueryInstance.Owner.Get(), 0);
check(PlayerPawn);
// add the actor data to the context
UEnvQueryItemType_Actor::SetContextHelper(ContextData, PlayerPawn);
}