mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 11:12:23 +01:00
<feat: New project structure>
<feat: New release>
This commit is contained in:
49
dependencies/reboot/Project Reboot 3.0/BuildingContainer.cpp
vendored
Normal file
49
dependencies/reboot/Project Reboot 3.0/BuildingContainer.cpp
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "BuildingContainer.h"
|
||||
#include "FortPickup.h"
|
||||
#include "FortLootPackage.h"
|
||||
#include "FortGameModeAthena.h"
|
||||
#include "gui.h"
|
||||
|
||||
bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn)
|
||||
{
|
||||
if (!Pawn)
|
||||
return false;
|
||||
|
||||
this->ForceNetUpdate();
|
||||
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
|
||||
FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorForwardVector() * this->GetLootSpawnLocation_Athena().X + this->GetActorRightVector() * this->GetLootSpawnLocation_Athena().Y + this->GetActorUpVector() * this->GetLootSpawnLocation_Athena().Z;
|
||||
|
||||
auto RedirectedLootTier = GameMode->RedirectLootTier(GetSearchLootTierGroup());
|
||||
|
||||
// LOG_INFO(LogInteraction, "RedirectedLootTier: {}", RedirectedLootTier.ToString());
|
||||
|
||||
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
|
||||
|
||||
auto LootDrops = PickLootDrops(RedirectedLootTier, GameState->GetWorldLevel(), -1, bDebugPrintLooting);
|
||||
|
||||
// LOG_INFO(LogInteraction, "LootDrops.size(): {}", LootDrops.size());
|
||||
|
||||
for (auto& lootDrop : LootDrops)
|
||||
{
|
||||
PickupCreateData CreateData;
|
||||
CreateData.bToss = true;
|
||||
// CreateData.PawnOwner = Pawn;
|
||||
CreateData.ItemEntry = lootDrop.ItemEntry;
|
||||
CreateData.SpawnLocation = LocationToSpawnLoot;
|
||||
CreateData.SourceType = EFortPickupSourceTypeFlag::GetContainerValue();
|
||||
CreateData.bRandomRotation = true;
|
||||
CreateData.bShouldFreeItemEntryWhenDeconstructed = true;
|
||||
|
||||
auto NewPickup = AFortPickup::SpawnPickup(CreateData);
|
||||
}
|
||||
|
||||
if (!this->IsDestroyed())
|
||||
{
|
||||
this->ForceNetUpdate();
|
||||
// a buncha other stuff
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user