init bosses

This commit is contained in:
Marvelco
2025-08-07 18:27:56 +03:00
parent a2afb47cfa
commit 3dbb83a96f
5 changed files with 40 additions and 9 deletions

View File

@@ -1,10 +1,22 @@
#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)
UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData)
{
LOG_INFO(LogBots, "SpawnBotHook!");
return nullptr;
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;
}