This commit is contained in:
Gray
2024-03-16 12:35:01 -04:00
parent 05cd0858d3
commit d5cb974911
7 changed files with 41 additions and 25 deletions

View File

@@ -6,7 +6,7 @@ UFortWeaponItemDefinition* AFortAthenaVehicle::GetVehicleWeaponForSeat(int SeatI
UFortWeaponItemDefinition* VehicleWeaponDefinition = nullptr; UFortWeaponItemDefinition* VehicleWeaponDefinition = nullptr;
LOG_INFO(LogDev, "SeatIndex: {}", SeatIdx); LOG_INFO(LogDev, "[GetVehicleWeaponForSeat] SeatIndex: {}", SeatIdx);
UObject* WeaponComponent = nullptr; UObject* WeaponComponent = nullptr;

View File

@@ -1596,6 +1596,8 @@ 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). if (Fortnite_Version < 6) // Spectating (is this the actual build or is it like 6.10 when they added it auto).
{
if (GameState->GetGamePhase() > EAthenaGamePhase::Warmup)
{ {
static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath"); static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath");
@@ -1614,6 +1616,7 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
} }
} }
} }
}
if (IsRestartingSupported() && Globals::bAutoRestart && !bIsInAutoRestart) if (IsRestartingSupported() && Globals::bAutoRestart && !bIsInAutoRestart)
{ {

View File

@@ -436,7 +436,7 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl
if (Globals::bNoMCP) if (Globals::bNoMCP)
{ {
static auto CustomCharacterPartClass = FindObject<UClass>("/Script/FortniteGame.CustomCharacterPart"); static auto CustomCharacterPartClass = FindObject<UClass>(L"/Script/FortniteGame.CustomCharacterPart");
static auto backpackPart = LoadObject("/Game/Characters/CharacterParts/Backpacks/NoBackpack.NoBackpack", CustomCharacterPartClass); static auto backpackPart = LoadObject("/Game/Characters/CharacterParts/Backpacks/NoBackpack.NoBackpack", CustomCharacterPartClass);
// PawnAsFort->ServerChoosePart(EFortCustomPartType::Backpack, backpackPart); // PawnAsFort->ServerChoosePart(EFortCustomPartType::Backpack, backpackPart);

View File

@@ -246,12 +246,13 @@ void AFortPlayerPawn::UnEquipVehicleWeaponDefinition(UFortWeaponItemDefinition*
if (bShouldUpdate) if (bShouldUpdate)
WorldInventory->Update(); WorldInventory->Update();
auto PickaxeInstance = WorldInventory->GetPickaxeInstance(); auto LastItemInstance = WorldInventory->GetPickaxeInstance(); // Bad, we should get the last item.
if (!PickaxeInstance) if (!LastItemInstance)
return; 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) 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) AActor* AFortPlayerPawn::ServerOnExitVehicleHook(AFortPlayerPawn* PlayerPawn, ETryExitVehicleBehavior ExitForceBehavior)
{ {
auto VehicleWeaponDefinition = PlayerPawn->GetVehicleWeaponDefinition(PlayerPawn->GetVehicle()); auto Vehicle = PlayerPawn->GetVehicle();
LOG_INFO(LogDev, "VehicleWeaponDefinition: {}", VehicleWeaponDefinition ? VehicleWeaponDefinition->GetFullName() : "BadRead"); auto VehicleWeaponDefinition = PlayerPawn->GetVehicleWeaponDefinition(Vehicle);
LOG_INFO(LogDev, "[Leave] {} VehicleWeaponDefinition: {}", __int64(Vehicle), VehicleWeaponDefinition ? VehicleWeaponDefinition->GetFullName() : "BadRead");
PlayerPawn->UnEquipVehicleWeaponDefinition(VehicleWeaponDefinition); PlayerPawn->UnEquipVehicleWeaponDefinition(VehicleWeaponDefinition);
return ServerOnExitVehicleOriginal(PlayerPawn, ExitForceBehavior); return ServerOnExitVehicleOriginal(PlayerPawn, ExitForceBehavior);

View File

@@ -118,6 +118,9 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
bool bSendHelpMessage = false; bool bSendHelpMessage = false;
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
if (Arguments.size() >= 1) if (Arguments.size() >= 1)
{ {
auto& Command = Arguments[0]; auto& Command = Arguments[0];
@@ -769,15 +772,12 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
} }
else if (Command == "pausesafezone") else if (Command == "pausesafezone")
{ {
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"pausesafezone", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"pausesafezone", nullptr);
// GameMode->PauseSafeZone(GameState->IsSafeZonePaused() == 0); // GameMode->PauseSafeZone(GameState->IsSafeZonePaused() == 0);
} }
else if (Command == "teleport" || Command == "tp") else if (Command == "teleport" || Command == "tp")
{ {
auto CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass()); UCheatManager*& CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass());
if (!CheatManager) if (!CheatManager)
{ {
@@ -789,6 +789,11 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
CheatManager = nullptr; CheatManager = nullptr;
SendMessageToConsole(PlayerController, L"Teleported!"); SendMessageToConsole(PlayerController, L"Teleported!");
} }
else if (Command == "startaircraft")
{
GameMode->StartAircraftPhase();
SendMessageToConsole(PlayerController, L"Started aircraft!");
}
else if (Command == "wipequickbar" || Command == "wipequickbars") else if (Command == "wipequickbar" || Command == "wipequickbars")
{ {
bool bWipePrimary = false; bool bWipePrimary = false;
@@ -879,7 +884,7 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
} }
else if (Command == "destroytarget") else if (Command == "destroytarget")
{ {
auto CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass()); UCheatManager*& CheatManager = ReceivingController->SpawnCheatManager(UCheatManager::StaticClass());
if (!CheatManager) if (!CheatManager)
{ {
@@ -943,6 +948,7 @@ cheat destroytarget - Destroys the actor that the player is looking at.
cheat wipequickbar <Primary|Secondary> <RemoveUndroppables=false> - Wipes the specified quickbar (parameters is not case sensitive). cheat wipequickbar <Primary|Secondary> <RemoveUndroppables=false> - Wipes the specified quickbar (parameters is not case sensitive).
cheat wipequickbars <RemoveUndroppables=false> - Wipes primary and secondary quickbar of targeted player (parameter is not case sensitive). cheat wipequickbars <RemoveUndroppables=false> - 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 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
)"; )";

View File

@@ -1519,6 +1519,9 @@ static inline uint64 FindGetNetMode()
static inline uint64 FindApplyCharacterCustomization() 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(); 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) if (!Addrr)

View File

@@ -794,7 +794,9 @@ static inline void MainUI()
if (!bStartedBus) 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")) if (ImGui::Button("Start Bus"))
{ {