diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index f13799b..8791ee7 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -577,24 +577,24 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game } } - // if (!Globals::bCreative) // ?? - { - static auto FortPlayerStartCreativeClass = FindObject(L"/Script/FortniteGame.FortPlayerStartCreative"); - static auto FortPlayerStartWarmupClass = FindObject(L"/Script/FortniteGame.FortPlayerStartWarmup"); - TArray Actors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), Globals::bCreative ? FortPlayerStartCreativeClass : FortPlayerStartWarmupClass); + static auto FortPlayerStartCreativeClass = FindObject(L"/Script/FortniteGame.FortPlayerStartCreative"); + static auto FortPlayerStartWarmupClass = FindObject(L"/Script/FortniteGame.FortPlayerStartWarmup"); + TArray Actors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), Globals::bCreative ? FortPlayerStartCreativeClass : FortPlayerStartWarmupClass); - int ActorsNum = Actors.Num(); + int ActorsNum = Actors.Num(); - Actors.Free(); + Actors.Free(); - if (ActorsNum == 0) - return false; - } + if (ActorsNum == 0) + return false; auto MapInfo = GameState->GetMapInfo(); - - if (!MapInfo && Engine_Version >= 421) - return false; + + if (!bUseCustomMap) + { + if (!MapInfo && Engine_Version >= 421) + return false; + } static int LastNum = 1; diff --git a/Project Reboot 3.0/commands.h b/Project Reboot 3.0/commands.h index 6e23bd9..3b0663e 100644 --- a/Project Reboot 3.0/commands.h +++ b/Project Reboot 3.0/commands.h @@ -459,16 +459,27 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) auto& weaponName = Arguments[1]; int count = 1; + int amount = 1; try { if (NumArgs >= 2) count = std::stoi(Arguments[2]); + if (NumArgs >= 3) + amount = std::stoi(Arguments[3]); } catch (...) { } + constexpr int Max = 100; + + if (amount > Max) + { + SendMessageToConsole(PlayerController, (std::wstring(L"You went over the limit! Only spawning ") + std::to_wstring(Max) + L".").c_str()); + amount = Max; + } + // LOG_INFO(LogDev, "weaponName: {}", weaponName); auto WID = Cast(FindObject(weaponName, nullptr, ANY_PACKAGE)); @@ -488,7 +499,10 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) CreateData.SpawnLocation = Location; CreateData.bShouldFreeItemEntryWhenDeconstructed = true; - AFortPickup::SpawnPickup(CreateData); + for (int i = 0; i < amount; i++) + { + AFortPickup::SpawnPickup(CreateData); + } } else if (Command == "listplayers") { @@ -875,7 +889,7 @@ cheat pausesafezone - Pauses the zone. cheat sethealth - Sets executing player's health. cheat setshield - Sets executing player's shield. cheat applycid - Sets a player's character. -cheat spawnpickup - Spawns a pickup at specified player. +cheat spawnpickup - Spawns a pickup at specified player. cheat teleport - Teleports to what the player is looking at. cheat spawnbot - Spawns a bot at the player (experimental). cheat setpickaxe - Set player's pickaxe. diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 6991f43..d099dd1 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -258,21 +258,26 @@ void ChangeLevels() LOG_INFO(LogDev, "FindGIsClient(): 0x{:x}", FindGIsClient() - __int64(GetModuleHandleW(0))); - FString LevelB = Engine_Version < 424 + // auto bruh = std::wstring(CustomMapName.begin(), CustomMapName.end()); + // auto bruhh = (L"open " + bruh); + + FString LevelB = /* bUseCustomMap ? bruhh.c_str() : */ (Engine_Version < 424 ? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501 ? L"open Asteria_Terrain" : Globals::bCreative ? L"open Creative_NoApollo_Terrain" : L"open Artemis_Terrain" : Globals::bCreative ? L"open Creative_NoApollo_Terrain" - : L"open Apollo_Terrain"; + : L"open Apollo_Terrain"); - FString Level = Engine_Version < 424 + FString Level = /* bUseCustomMap ? bruh.c_str() : */ (Engine_Version < 424 ? L"Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501 ? L"Asteria_Terrain" : Globals::bCreative ? L"Creative_NoApollo_Terrain" : L"Artemis_Terrain" : Globals::bCreative ? L"Creative_NoApollo_Terrain" - : L"Apollo_Terrain"; + : L"Apollo_Terrain"); + + LOG_INFO(LogDev, "Using {}.", bUseSwitchLevel ? Level.ToString() : LevelB.ToString()); if (bUseSwitchLevel) { diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 6219edf..b9ddef8 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -61,6 +61,8 @@ #define LOADOUT_PLAYERTAB 4 #define FUN_PLAYERTAB 5 +extern inline bool bUseCustomMap = false; +extern inline std::string CustomMapName = ""; extern inline int AmountToSubtractIndex = 1; extern inline int SecondsUntilTravel = 5; extern inline bool bSwitchedInitialLevel = false; @@ -1291,8 +1293,17 @@ static inline void PregameUI() } if (!bSwitchedInitialLevel) + { + ImGui::Checkbox("Use Custom Map", &bUseCustomMap); + + if (bUseCustomMap) + { + // ImGui::InputText("Custom Map", &CustomMapName); + } + ImGui::SliderInt("Seconds until load into map", &SecondsUntilTravel, 1, 100); - + } + if (!Globals::bCreative) ImGui::InputText("Playlist", &PlaylistName); }