diff --git a/Project Reboot 3.0/FortAthenaVehicle.cpp b/Project Reboot 3.0/FortAthenaVehicle.cpp index b0e7088..327b5ae 100644 --- a/Project Reboot 3.0/FortAthenaVehicle.cpp +++ b/Project Reboot 3.0/FortAthenaVehicle.cpp @@ -6,7 +6,7 @@ UFortWeaponItemDefinition* AFortAthenaVehicle::GetVehicleWeaponForSeat(int SeatI UFortWeaponItemDefinition* VehicleWeaponDefinition = nullptr; - LOG_INFO(LogDev, "SeatIndex: {}", SeatIdx); + LOG_INFO(LogDev, "[GetVehicleWeaponForSeat] SeatIndex: {}", SeatIdx); UObject* WeaponComponent = nullptr; diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index acb42a5..4db7314 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -1597,20 +1597,23 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo if (Fortnite_Version < 6) // Spectating (is this the actual build or is it like 6.10 when they added it auto). { - static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath"); - - bool bAllowSpectate = GameMode->Get(bAllowSpectateAfterDeathOffset); - - LOG_INFO(LogDev, "bAllowSpectate: {}", bAllowSpectate); - - if (bAllowSpectate) + if (GameState->GetGamePhase() > EAthenaGamePhase::Warmup) { - LOG_INFO(LogDev, "Starting Spectating!"); + static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath"); - static auto PlayerToSpectateOnDeathOffset = PlayerController->GetOffset("PlayerToSpectateOnDeath"); - PlayerController->Get(PlayerToSpectateOnDeathOffset) = KillerPawn; + bool bAllowSpectate = GameMode->Get(bAllowSpectateAfterDeathOffset); - CreateThread(0, 0, SpectateThread, (LPVOID)PlayerController, 0, 0); + LOG_INFO(LogDev, "bAllowSpectate: {}", bAllowSpectate); + + if (bAllowSpectate) + { + LOG_INFO(LogDev, "Starting Spectating!"); + + static auto PlayerToSpectateOnDeathOffset = PlayerController->GetOffset("PlayerToSpectateOnDeath"); + PlayerController->Get(PlayerToSpectateOnDeathOffset) = KillerPawn; + + CreateThread(0, 0, SpectateThread, (LPVOID)PlayerController, 0, 0); + } } } } diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.cpp b/Project Reboot 3.0/FortPlayerControllerAthena.cpp index acd2d31..389e85c 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.cpp +++ b/Project Reboot 3.0/FortPlayerControllerAthena.cpp @@ -436,7 +436,7 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl if (Globals::bNoMCP) { - static auto CustomCharacterPartClass = FindObject("/Script/FortniteGame.CustomCharacterPart"); + static auto CustomCharacterPartClass = FindObject(L"/Script/FortniteGame.CustomCharacterPart"); static auto backpackPart = LoadObject("/Game/Characters/CharacterParts/Backpacks/NoBackpack.NoBackpack", CustomCharacterPartClass); // PawnAsFort->ServerChoosePart(EFortCustomPartType::Backpack, backpackPart); diff --git a/Project Reboot 3.0/FortPlayerPawn.cpp b/Project Reboot 3.0/FortPlayerPawn.cpp index 263a71d..f6828d0 100644 --- a/Project Reboot 3.0/FortPlayerPawn.cpp +++ b/Project Reboot 3.0/FortPlayerPawn.cpp @@ -246,12 +246,13 @@ void AFortPlayerPawn::UnEquipVehicleWeaponDefinition(UFortWeaponItemDefinition* if (bShouldUpdate) WorldInventory->Update(); - auto PickaxeInstance = WorldInventory->GetPickaxeInstance(); + auto LastItemInstance = WorldInventory->GetPickaxeInstance(); // Bad, we should get the last item. - if (!PickaxeInstance) + if (!LastItemInstance) return; - AFortPlayerController::ServerExecuteInventoryItemHook(PlayerController, PickaxeInstance->GetItemEntry()->GetItemGuid()); // Bad, we should equip the last weapon. + PlayerController->ServerExecuteInventoryItemHook(PlayerController, LastItemInstance->GetItemEntry()->GetItemGuid()); + PlayerController->ClientEquipItem(LastItemInstance->GetItemEntry()->GetItemGuid(), true); } void AFortPlayerPawn::StartGhostModeExitHook(UObject* Context, FFrame* Stack, void* Ret) @@ -286,8 +287,9 @@ void AFortPlayerPawn::StartGhostModeExitHook(UObject* Context, FFrame* Stack, vo AActor* AFortPlayerPawn::ServerOnExitVehicleHook(AFortPlayerPawn* PlayerPawn, ETryExitVehicleBehavior ExitForceBehavior) { - auto VehicleWeaponDefinition = PlayerPawn->GetVehicleWeaponDefinition(PlayerPawn->GetVehicle()); - LOG_INFO(LogDev, "VehicleWeaponDefinition: {}", VehicleWeaponDefinition ? VehicleWeaponDefinition->GetFullName() : "BadRead"); + auto Vehicle = PlayerPawn->GetVehicle(); + auto VehicleWeaponDefinition = PlayerPawn->GetVehicleWeaponDefinition(Vehicle); + LOG_INFO(LogDev, "[Leave] {} VehicleWeaponDefinition: {}", __int64(Vehicle), VehicleWeaponDefinition ? VehicleWeaponDefinition->GetFullName() : "BadRead"); PlayerPawn->UnEquipVehicleWeaponDefinition(VehicleWeaponDefinition); return ServerOnExitVehicleOriginal(PlayerPawn, ExitForceBehavior); diff --git a/Project Reboot 3.0/commands.cpp b/Project Reboot 3.0/commands.cpp index 89f6fed..d861336 100644 --- a/Project Reboot 3.0/commands.cpp +++ b/Project Reboot 3.0/commands.cpp @@ -118,6 +118,9 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) bool bSendHelpMessage = false; + auto GameState = Cast(GetWorld()->GetGameState()); + auto GameMode = Cast(GetWorld()->GetGameMode()); + if (Arguments.size() >= 1) { auto& Command = Arguments[0]; @@ -769,15 +772,12 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) } else if (Command == "pausesafezone") { - auto GameState = Cast(GetWorld()->GetGameState()); - auto GameMode = Cast(GetWorld()->GetGameMode()); - UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"pausesafezone", nullptr); // GameMode->PauseSafeZone(GameState->IsSafeZonePaused() == 0); } else if (Command == "teleport" || Command == "tp") { - auto CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass()); + UCheatManager*& CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass()); if (!CheatManager) { @@ -789,6 +789,11 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) CheatManager = nullptr; SendMessageToConsole(PlayerController, L"Teleported!"); } + else if (Command == "startaircraft") + { + GameMode->StartAircraftPhase(); + SendMessageToConsole(PlayerController, L"Started aircraft!"); + } else if (Command == "wipequickbar" || Command == "wipequickbars") { bool bWipePrimary = false; @@ -879,7 +884,7 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) } else if (Command == "destroytarget") { - auto CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass()); + UCheatManager*& CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass()); if (!CheatManager) { @@ -942,7 +947,8 @@ cheat setpickaxe - Set player's pickaxe. Can be either the PID or WI cheat destroytarget - Destroys the actor that the player is looking at. cheat wipequickbar - Wipes the specified quickbar (parameters is not case sensitive). cheat wipequickbars - Wipes primary and secondary quickbar of targeted player (parameter is not case sensitive). -cheat suicide - Makes targeted player suicide. +cheat suicide - Makes targeted player suicide. +cheat startaircraft - Starts the aircraft (may work). If you want to execute a command on a certain player, surround their name (case sensitive) with \, and put the param with their name anywhere. Example: cheat sethealth \Milxnor\ 100 )"; diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 1e411f2..726b2d6 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -1519,6 +1519,9 @@ static inline uint64 FindGetNetMode() static inline uint64 FindApplyCharacterCustomization() { + if (std::floor(Fortnite_Version) == 4) // RetrieveCharacterParts return null if dedicated server????? + return 0; + auto Addrr = Memcury::Scanner::FindStringRef(L"AFortPlayerState::ApplyCharacterCustomization - Failed initialization, using default parts. Player Controller: %s PlayerState: %s, HeroId: %s", false, 0, Fortnite_Version >= 20, true).Get(); if (!Addrr) diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 5ecad51..a7cb2f0 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -794,7 +794,9 @@ static inline void MainUI() if (!bStartedBus) { - if (Globals::bLateGame.load() || Fortnite_Version >= 11) + if (Globals::bLateGame.load() + || Fortnite_Version >= 11 // Its been a minute but iirc it just wouldnt start when countdown ended or crash? cant remember + ) { if (ImGui::Button("Start Bus")) {