Added NPC logic
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// © 2025 Naked People Team. All Rights Reserved.
|
||||
|
||||
|
||||
#include "NPCTargetLocation.h"
|
||||
#include "NPC.h"
|
||||
|
||||
|
||||
ANPCTargetLocation::ANPCTargetLocation()
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = false;
|
||||
}
|
||||
|
||||
bool ANPCTargetLocation::TryClaim(ANPC* InClaimant)
|
||||
{
|
||||
if (Claimant.IsValid() && Claimant.Get() != InClaimant)
|
||||
return false;
|
||||
|
||||
Claimant = InClaimant;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ANPCTargetLocation::Release(ANPC* Requester)
|
||||
{
|
||||
if (!Claimant.IsValid() || Claimant.Get() != Requester)
|
||||
return;
|
||||
|
||||
Claimant = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user