mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
a lot
add mat depletion, ammo cost, fixed dying crashing on s16+, fix aircraft starting on some versions, fix zone on s17
This commit is contained in:
@@ -1,14 +1,37 @@
|
||||
#include "FortInventoryInterface.h"
|
||||
|
||||
#include "reboot.h"
|
||||
#include "FortPlayerControllerAthena.h"
|
||||
|
||||
char UFortInventoryInterface::RemoveInventoryItemHook(__int64 a1, FGuid a2, int Count, char bForceRemoveFromQuickBars, char bForceRemoval)
|
||||
{
|
||||
// kms bruh
|
||||
|
||||
static auto FortPlayerControllerSuperSize = (*(UClass**)(__int64(FindObject<UClass>("/Script/FortniteGame.FortPlayerController")) + Offsets::SuperStruct))->GetPropertiesSize();
|
||||
auto Controller = *(UObject**)(__int64(a1) - (FortPlayerControllerSuperSize + 8));
|
||||
int SuperAdditionalOffset = Engine_Version >= 427 ? 16 : 8;
|
||||
auto ControllerObject = (UObject*)(__int64(a1) - (FortPlayerControllerSuperSize + SuperAdditionalOffset));
|
||||
|
||||
LOG_INFO(LogDev, "FortPlayerControllerSuperSize: {}", FortPlayerControllerSuperSize);
|
||||
LOG_INFO(LogDev, "Controller: {}", Controller->GetFullName());
|
||||
LOG_INFO(LogDev, "ControllerObject: {}", ControllerObject->GetFullName());
|
||||
|
||||
if (!ControllerObject)
|
||||
return false;
|
||||
|
||||
auto PlayerController = Cast<AFortPlayerControllerAthena>(ControllerObject);
|
||||
|
||||
if (!PlayerController)
|
||||
return false;
|
||||
|
||||
auto WorldInventory = PlayerController->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
return false;
|
||||
|
||||
bool bShouldUpdate = false;
|
||||
WorldInventory->RemoveItem(a2, &bShouldUpdate, Count);
|
||||
|
||||
if (bShouldUpdate)
|
||||
WorldInventory->Update();
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user