level showing up on items now, fix s19, improve performance, fix big issue on s5
This commit is contained in:
Milxnor
2023-05-21 00:38:59 -04:00
parent 33433ea9de
commit a2d621560a
37 changed files with 600 additions and 168 deletions

View File

@@ -1,8 +1,9 @@
#include "FortAthenaSupplyDrop.h"
#include "FortGameStateAthena.h"
FVector AFortAthenaSupplyDrop::FindGroundLocationAt(FVector InLocation)
{
static auto FindGroundLocationAtFn = FindObject<UFunction>("/Script/FortniteGame.FortAthenaSupplyDrop.FindGroundLocationAt");
static auto FindGroundLocationAtFn = FindObject<UFunction>(L"/Script/FortniteGame.FortAthenaSupplyDrop.FindGroundLocationAt");
struct
{
@@ -44,12 +45,15 @@ AFortPickup* AFortAthenaSupplyDrop::SpawnGameModePickupHook(UObject* Context, FF
LOG_INFO(LogDev, "Spawning GameModePickup with ItemDefinition: {}", ItemDefinition->GetFullName());
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
PickupCreateData CreateData;
CreateData.ItemEntry = FFortItemEntry::MakeItemEntry(ItemDefinition, NumberToSpawn, -1);
CreateData.ItemEntry = FFortItemEntry::MakeItemEntry(ItemDefinition, NumberToSpawn, -1, MAX_DURABILITY, ItemDefinition->GetFinalLevel(GameState->GetWorldLevel()));
CreateData.SpawnLocation = Position;
CreateData.PawnOwner = TriggeringPawn;
CreateData.Source = EFortPickupSpawnSource::GetSupplyDropValue();
CreateData.OverrideClass = PickupClass;
CreateData.bShouldFreeItemEntryWhenDeconstructed = true;
*Ret = AFortPickup::SpawnPickup(CreateData);
return *Ret;
@@ -74,8 +78,10 @@ AFortPickup* AFortAthenaSupplyDrop::SpawnPickupHook(UObject* Context, FFrame& St
if (!ItemDefinition)
return nullptr;
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
PickupCreateData CreateData;
CreateData.ItemEntry = FFortItemEntry::MakeItemEntry(ItemDefinition, NumberToSpawn, -1);
CreateData.ItemEntry = FFortItemEntry::MakeItemEntry(ItemDefinition, NumberToSpawn, -1, MAX_DURABILITY, ItemDefinition->GetFinalLevel(GameState->GetWorldLevel()));
CreateData.SpawnLocation = Position;
CreateData.PawnOwner = TriggeringPawn;
CreateData.Source = EFortPickupSpawnSource::GetSupplyDropValue();