fix a bug with restarting, clean up some stuff, fix a playlist specific bug, add hold pickup to swap, fix shadow stones and stuff spawn height, code consistency, fix bugs with dropping
This commit is contained in:
Milxnor
2023-04-30 12:15:29 -04:00
parent 891f45f469
commit 18f92ccf52
24 changed files with 401 additions and 236 deletions

View File

@@ -885,7 +885,7 @@ void AFortPlayerController::DropSpecificItemHook(UObject* Context, FFrame& Stack
void AFortPlayerController::ServerAttemptInventoryDropHook(AFortPlayerController* PlayerController, FGuid ItemGuid, int Count)
{
LOG_INFO(LogDev, "ServerAttemptInventoryDropHook!");
LOG_INFO(LogDev, "ServerAttemptInventoryDropHook Dropping: {}", Count);
auto Pawn = PlayerController->GetMyFortPawn();
@@ -895,7 +895,7 @@ void AFortPlayerController::ServerAttemptInventoryDropHook(AFortPlayerController
auto WorldInventory = PlayerController->GetWorldInventory();
auto ReplicatedEntry = WorldInventory->FindReplicatedEntry(ItemGuid);
if (!ReplicatedEntry)
if (!ReplicatedEntry || ReplicatedEntry->GetCount() < Count)
return;
auto ItemDefinition = Cast<UFortWorldItemDefinition>(ReplicatedEntry->GetItemDefinition());
@@ -908,7 +908,7 @@ void AFortPlayerController::ServerAttemptInventoryDropHook(AFortPlayerController
if (!ItemDefinition->ShouldIgnoreRespawningOnDrop() && (DropBehaviorOffset != -1 ? ItemDefinition->GetDropBehavior() != EWorldItemDropBehavior::DestroyOnDrop : true))
{
auto Pickup = AFortPickup::SpawnPickup(ReplicatedEntry, Pawn->GetActorLocation(),
EFortPickupSourceTypeFlag::Player, EFortPickupSpawnSource::Unset, Pawn);
EFortPickupSourceTypeFlag::Player, EFortPickupSpawnSource::Unset, Pawn, nullptr, true, Count);
if (!Pickup)
return;