Files
Project-Reboot-3.0/Project Reboot 3.0/FortServerBotManagerAthena.cpp
2025-08-07 18:27:56 +03:00

22 lines
941 B
C++

#include "FortServerBotManagerAthena.h"
#include "bots.h"
#include "ai.h"
#include "finder.h"
AFortPlayerPawnAthena* UFortServerBotManagerAthena::SpawnBotHook(UFortServerBotManagerAthena* BotManager, FVector& InSpawnLocation, FRotator& InSpawnRotation,
UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData)
{
LOG_INFO(LogBots, "SpawnBotHook!");
if (__int64(_ReturnAddress()) == SpawnBotRet()) {
return SpawnBotOriginal(BotManager, InSpawnLocation, InSpawnRotation, InBotData, InRuntimeBotData);
}
AActor* SpawnLocator = GetWorld()->SpawnActor<APawn>(APawn::StaticClass(), InSpawnLocation, InSpawnRotation.Quaternion());
auto PawnClass = InBotData->Get<UClass*>(InBotData->GetOffset("PawnClass"));
auto Pawn = BotMutator->SpawnBot(PawnClass , SpawnLocator, InSpawnLocation, InSpawnRotation, true);
Pawn->TeleportTo(InSpawnLocation, InSpawnRotation);//idfk????
return Pawn;
}