mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
fix some playlist starter loot, cleanup some code, fix death bugs on 1.8 and 1.7.2, fix reloading not taking items on 1.8 and 1.7.2, fix looting on s9, fix some s15 & s16 builds, fix bug with higher version looting
26 lines
1017 B
C++
26 lines
1017 B
C++
#include "BuildingContainer.h"
|
|
#include "FortPickup.h"
|
|
#include "FortLootPackage.h"
|
|
#include "FortGameModeAthena.h"
|
|
|
|
bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn)
|
|
{
|
|
FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorRightVector() * 70.f + FVector{ 0, 0, 50 };
|
|
|
|
static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup");
|
|
auto RedirectedLootTier = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode())->RedirectLootTier(this->Get<FName>(SearchLootTierGroupOffset));
|
|
|
|
// LOG_INFO(LogInteraction, "RedirectedLootTier: {}", RedirectedLootTier.ToString());
|
|
|
|
auto LootDrops = PickLootDrops(RedirectedLootTier, true);
|
|
|
|
// LOG_INFO(LogInteraction, "LootDrops.size(): {}", LootDrops.size());
|
|
|
|
for (int i = 0; i < LootDrops.size(); i++)
|
|
{
|
|
auto& lootDrop = LootDrops.at(i);
|
|
AFortPickup::SpawnPickup(lootDrop.ItemDefinition, LocationToSpawnLoot, lootDrop.Count, EFortPickupSourceTypeFlag::Container, EFortPickupSpawnSource::Unset, lootDrop.LoadedAmmo);
|
|
}
|
|
|
|
return true;
|
|
} |