mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
a bit
start work on vending machines, fix some playlist specific things, fixed a bug with <s5 playlist looting,
This commit is contained in:
@@ -352,6 +352,40 @@ void UFortKismetLibrary::K2_GiveItemToPlayerHook(UObject* Context, FFrame& Stack
|
||||
return K2_GiveItemToPlayerOriginal(Context, Stack, Ret);
|
||||
}
|
||||
|
||||
void UFortKismetLibrary::K2_GiveBuildingResourceHook(UObject* Context, FFrame& Stack, void* Ret)
|
||||
{
|
||||
LOG_INFO(LogDev, "K2_GiveBuildingResourceHook!");
|
||||
|
||||
AFortPlayerController* Controller;
|
||||
EFortResourceType ResourceType;
|
||||
int ResourceAmount;
|
||||
|
||||
Stack.StepCompiledIn(&Controller);
|
||||
Stack.StepCompiledIn(&ResourceType);
|
||||
Stack.StepCompiledIn(&ResourceAmount);
|
||||
|
||||
if (!Controller)
|
||||
return K2_GiveBuildingResourceOriginal(Context, Stack, Ret);
|
||||
|
||||
auto WorldInventory = Controller->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
return K2_GiveBuildingResourceOriginal(Context, Stack, Ret);
|
||||
|
||||
auto ItemDefinition = UFortKismetLibrary::K2_GetResourceItemDefinition(ResourceType);
|
||||
|
||||
if (!ItemDefinition)
|
||||
return K2_GiveBuildingResourceOriginal(Context, Stack, Ret);
|
||||
|
||||
bool bShouldUpdate = false;
|
||||
WorldInventory->AddItem(ItemDefinition, &bShouldUpdate, ResourceAmount, 0);
|
||||
|
||||
if (bShouldUpdate)
|
||||
WorldInventory->Update();
|
||||
|
||||
return K2_GiveBuildingResourceOriginal(Context, Stack, Ret);
|
||||
}
|
||||
|
||||
void UFortKismetLibrary::K2_RemoveFortItemFromPlayerHook(UObject* Context, FFrame& Stack, void* Ret)
|
||||
{
|
||||
AFortPlayerController* PlayerController = nullptr; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
|
||||
Reference in New Issue
Block a user