mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
fixed bot winning on many versions
This commit is contained in:
@@ -48,6 +48,7 @@ public:
|
|||||||
|
|
||||||
static bool ShouldUseAIBotController()
|
static bool ShouldUseAIBotController()
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
return Fortnite_Version >= 11 && Engine_Version < 500;
|
return Fortnite_Version >= 11 && Engine_Version < 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +219,7 @@ public:
|
|||||||
PlayerState->OnRep_PlayerName(); // ?
|
PlayerState->OnRep_PlayerName(); // ?
|
||||||
}
|
}
|
||||||
|
|
||||||
FString GetRandomName() // Todo SetName(GetRandomName())
|
FString GetRandomName()
|
||||||
{
|
{
|
||||||
static int CurrentBotNum = 1;
|
static int CurrentBotNum = 1;
|
||||||
std::wstring BotNumWStr;
|
std::wstring BotNumWStr;
|
||||||
@@ -314,7 +315,7 @@ public:
|
|||||||
auto PlayerAbilitySet = GetPlayerAbilitySet();
|
auto PlayerAbilitySet = GetPlayerAbilitySet();
|
||||||
auto AbilitySystemComponent = PlayerState->GetAbilitySystemComponent();
|
auto AbilitySystemComponent = PlayerState->GetAbilitySystemComponent();
|
||||||
|
|
||||||
if (PlayerAbilitySet)
|
if (PlayerAbilitySet && AbilitySystemComponent)
|
||||||
{
|
{
|
||||||
PlayerAbilitySet->GiveToAbilitySystem(AbilitySystemComponent);
|
PlayerAbilitySet->GiveToAbilitySystem(AbilitySystemComponent);
|
||||||
}
|
}
|
||||||
@@ -323,14 +324,16 @@ public:
|
|||||||
PickRandomLoadout();
|
PickRandomLoadout();
|
||||||
ApplyCosmeticLoadout();
|
ApplyCosmeticLoadout();
|
||||||
|
|
||||||
if (Fortnite_Version <= 10)
|
if (!ShouldUseAIBotController())
|
||||||
{
|
{
|
||||||
GameState->GetPlayersLeft()++;
|
++GameState->GetPlayersLeft();
|
||||||
GameState->OnRep_PlayersLeft();
|
GameState->OnRep_PlayersLeft();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto FortPlayerControllerAthena = Cast<AFortPlayerControllerAthena>(Controller))
|
if (auto FortPlayerControllerAthena = Cast<AFortPlayerControllerAthena>(Controller))
|
||||||
|
{
|
||||||
GameMode->GetAlivePlayers().Add(FortPlayerControllerAthena);
|
GameMode->GetAlivePlayers().Add(FortPlayerControllerAthena);
|
||||||
|
}
|
||||||
|
|
||||||
LOG_INFO(LogDev, "Finished spawning bot!")
|
LOG_INFO(LogDev, "Finished spawning bot!")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -751,6 +751,12 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
|
|||||||
}
|
}
|
||||||
else if (Command == "spawnbot")
|
else if (Command == "spawnbot")
|
||||||
{
|
{
|
||||||
|
if (GameState->GetGamePhase() < EAthenaGamePhase::Aircraft)
|
||||||
|
{
|
||||||
|
SendMessageToConsole(PlayerController, L"Bot spawning before aircraft is not allowed!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto Pawn = ReceivingController->GetPawn();
|
auto Pawn = ReceivingController->GetPawn();
|
||||||
|
|
||||||
if (!Pawn)
|
if (!Pawn)
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ static inline void StaticUI()
|
|||||||
ImGui::Checkbox("Infinite Ammo", &Globals::bInfiniteAmmo);
|
ImGui::Checkbox("Infinite Ammo", &Globals::bInfiniteAmmo);
|
||||||
ImGui::Checkbox("Infinite Materials", &Globals::bInfiniteMaterials);
|
ImGui::Checkbox("Infinite Materials", &Globals::bInfiniteMaterials);
|
||||||
|
|
||||||
ImGui::Checkbox("Private IP's are operator", &Globals::bPrivateIPsAreOperator);
|
ImGui::Checkbox("Private IPs are operator", &Globals::bPrivateIPsAreOperator);
|
||||||
|
|
||||||
ImGui::Checkbox("No MCP (Don't change unless you know what this is)", &Globals::bNoMCP);
|
ImGui::Checkbox("No MCP (Don't change unless you know what this is)", &Globals::bNoMCP);
|
||||||
|
|
||||||
@@ -1011,11 +1011,11 @@ static inline void MainUI()
|
|||||||
|
|
||||||
else if (Tab == DUMP_TAB)
|
else if (Tab == DUMP_TAB)
|
||||||
{
|
{
|
||||||
ImGui::Text("These will all be in your Win64 folder!");
|
ImGui::Text("These will all be in your Win64 folder!"); // TODO: Make a button to open this directory
|
||||||
|
|
||||||
static std::string FortniteVersionStr = std::format("Fortnite Version {}\n\n", std::to_string(Fortnite_Version));
|
static std::string FortniteVersionStr = std::format("Fortnite Version {}\n\n", std::to_string(Fortnite_Version));
|
||||||
|
|
||||||
if (ImGui::Button("Dump Objects"))
|
if (ImGui::Button("Dump Objects (ObjectsDump.txt)"))
|
||||||
{
|
{
|
||||||
auto ObjectNum = ChunkedObjects ? ChunkedObjects->Num() : UnchunkedObjects ? UnchunkedObjects->Num() : 0;
|
auto ObjectNum = ChunkedObjects ? ChunkedObjects->Num() : UnchunkedObjects ? UnchunkedObjects->Num() : 0;
|
||||||
|
|
||||||
@@ -1023,7 +1023,7 @@ static inline void MainUI()
|
|||||||
|
|
||||||
obj << FortniteVersionStr;
|
obj << FortniteVersionStr;
|
||||||
|
|
||||||
for (int i = 0; i < ObjectNum; i++)
|
for (int i = 0; i < ObjectNum; ++i)
|
||||||
{
|
{
|
||||||
auto CurrentObject = GetObjectByIndex(i);
|
auto CurrentObject = GetObjectByIndex(i);
|
||||||
|
|
||||||
@@ -1042,11 +1042,11 @@ static inline void MainUI()
|
|||||||
{
|
{
|
||||||
SkinsFile << FortniteVersionStr;
|
SkinsFile << FortniteVersionStr;
|
||||||
|
|
||||||
static auto CIDClass = FindObject<UClass>("/Script/FortniteGame.AthenaCharacterItemDefinition");
|
static auto CIDClass = FindObject<UClass>(L"/Script/FortniteGame.AthenaCharacterItemDefinition");
|
||||||
|
|
||||||
auto AllObjects = GetAllObjectsOfClass(CIDClass);
|
auto AllObjects = GetAllObjectsOfClass(CIDClass);
|
||||||
|
|
||||||
for (int i = 0; i < AllObjects.size(); i++)
|
for (int i = 0; i < AllObjects.size(); ++i)
|
||||||
{
|
{
|
||||||
auto CurrentCID = AllObjects.at(i);
|
auto CurrentCID = AllObjects.at(i);
|
||||||
|
|
||||||
@@ -1069,12 +1069,12 @@ static inline void MainUI()
|
|||||||
if (PlaylistsFile.is_open())
|
if (PlaylistsFile.is_open())
|
||||||
{
|
{
|
||||||
PlaylistsFile << FortniteVersionStr;
|
PlaylistsFile << FortniteVersionStr;
|
||||||
static auto FortPlaylistClass = FindObject<UClass>("/Script/FortniteGame.FortPlaylist");
|
static auto FortPlaylistClass = FindObject<UClass>(L"/Script/FortniteGame.FortPlaylist");
|
||||||
// static auto FortPlaylistClass = FindObject("Class /Script/FortniteGame.FortPlaylistAthena");
|
// static auto FortPlaylistClass = FindObject(L"Class /Script/FortniteGame.FortPlaylistAthena");
|
||||||
|
|
||||||
auto AllObjects = GetAllObjectsOfClass(FortPlaylistClass);
|
auto AllObjects = GetAllObjectsOfClass(FortPlaylistClass);
|
||||||
|
|
||||||
for (int i = 0; i < AllObjects.size(); i++)
|
for (int i = 0; i < AllObjects.size(); ++i)
|
||||||
{
|
{
|
||||||
auto Object = AllObjects.at(i);
|
auto Object = AllObjects.at(i);
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ static inline T* LoadObject(const TCHAR* Name, UClass* Class = T::StaticClass(),
|
|||||||
|
|
||||||
if (!Object)
|
if (!Object)
|
||||||
{
|
{
|
||||||
LOG_WARN(LogDev, "Failed to load object!");
|
std::wstring NameWStr = std::wstring(Name);
|
||||||
|
LOG_WARN(LogDev, "Failed to load object: {}!", std::string(NameWStr.begin(), NameWStr.end()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object;
|
return Object;
|
||||||
|
|||||||
Reference in New Issue
Block a user