creative stuff

This commit is contained in:
Milxnor
2023-03-13 22:03:18 -04:00
parent 2fd7f3b23f
commit 818bc8119b
23 changed files with 393 additions and 45 deletions

View File

@@ -0,0 +1,30 @@
#include "FortMinigame.h"
#include "FortPlayerControllerAthena.h"
void AFortMinigame::ClearPlayerInventoryHook(UObject* Context, FFrame& Stack, void* Ret)
{
auto Minigame = (AFortMinigame*)Context;
if (!Minigame)
return;
AFortPlayerControllerAthena* PlayerController = nullptr;
Stack.Step(Stack.Object, &PlayerController);
if (!PlayerController)
return;
auto& ItemInstances = PlayerController->GetWorldInventory()->GetItemList().GetItemInstances();
for (int i = 0; i < ItemInstances.Num(); i++)
{
auto ItemInstance = ItemInstances.at(i);
PlayerController->GetWorldInventory()->RemoveItem(ItemInstance->GetItemEntry()->GetItemGuid(), nullptr, ItemInstance->GetItemEntry()->GetCount());
}
PlayerController->GetWorldInventory()->Update();
return ClearPlayerInventoryOriginal(Context, Stack, Ret);
}