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;
LOG_INFO(LogDev, "SeatIndex: {}", SeatIdx);
LOG_INFO(LogDev, "[GetVehicleWeaponForSeat] SeatIndex: {}", SeatIdx);
UObject* WeaponComponent = nullptr;

View File

@@ -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<bool>(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<APawn*>(PlayerToSpectateOnDeathOffset) = KillerPawn;
bool bAllowSpectate = GameMode->Get<bool>(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<APawn*>(PlayerToSpectateOnDeathOffset) = KillerPawn;
CreateThread(0, 0, SpectateThread, (LPVOID)PlayerController, 0, 0);
}
}
}
}

View File

@@ -436,7 +436,7 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl
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);
// PawnAsFort->ServerChoosePart(EFortCustomPartType::Backpack, backpackPart);

View File

@@ -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);

View File

@@ -118,6 +118,9 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
bool bSendHelpMessage = false;
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
auto GameMode = Cast<AFortGameModeAthena>(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<AFortGameStateAthena>(GetWorld()->GetGameState());
auto GameMode = Cast<AFortGameModeAthena>(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 <PickaxeID> - Set player's pickaxe. Can be either the PID or WI
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 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
)";

View File

@@ -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)

View File

@@ -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"))
{