a good update

Added a very useful debugging tool, made looting even more proper
This commit is contained in:
Milxnor
2023-05-09 22:37:04 -04:00
parent b64f569551
commit 3fb5c4671d
34 changed files with 612 additions and 169 deletions

View File

@@ -3,6 +3,7 @@
#include "FortPickup.h"
#include "FortLootPackage.h"
#include "AbilitySystemComponent.h"
#include "FortGameStateAthena.h"
UFortResourceItemDefinition* UFortKismetLibrary::K2_GetResourceItemDefinition(EFortResourceType ResourceType)
{
@@ -601,13 +602,15 @@ bool UFortKismetLibrary::PickLootDropsHook(UObject* Context, FFrame& Stack, bool
LOG_INFO(LogDev, "Picking loot for {}.", TierGroupName.ComparisonIndex.Value ? TierGroupName.ToString() : "InvalidName");
auto LootDrops = PickLootDrops(TierGroupName, -1, true);
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
auto LootDrops = PickLootDrops(TierGroupName, GameState->GetWorldLevel(), -1, true);
for (int i = 0; i < LootDrops.size(); i++)
{
auto& LootDrop = LootDrops.at(i);
auto NewEntry = FFortItemEntry::MakeItemEntry(LootDrop->GetItemDefinition(), LootDrop->GetCount(), LootDrop->GetLoadedAmmo());
auto NewEntry = LootDrop.ItemEntry;
OutLootToDrop.AddPtr(NewEntry, FFortItemEntry::GetStructSize());
}