diff --git a/Project Reboot 3.0/FortAthenaMutator_InventoryOverride.h b/Project Reboot 3.0/FortAthenaMutator_InventoryOverride.h index 3d128bf..3647bdf 100644 --- a/Project Reboot 3.0/FortAthenaMutator_InventoryOverride.h +++ b/Project Reboot 3.0/FortAthenaMutator_InventoryOverride.h @@ -61,7 +61,7 @@ public: if (!TeamLoadouts) return FItemLoadoutTeamMap(); - for (int i = 0; i < TeamLoadouts->Num(); i++) + for (int i = 0; i < TeamLoadouts->Num(); ++i) { auto& TeamLoadout = TeamLoadouts->at(i); @@ -106,7 +106,7 @@ public: return Get(InventoryUpdateOverrideOffset); } - EAthenaLootDropOverride& GetDropAllItemsOverride(uint8_t TeamIndex = 255) + EAthenaLootDropOverride GetDropAllItemsOverride(uint8_t TeamIndex = 255) { if (TeamIndex != 255) { diff --git a/Project Reboot 3.0/FortInventory.cpp b/Project Reboot 3.0/FortInventory.cpp index f18fe37..512073b 100644 --- a/Project Reboot 3.0/FortInventory.cpp +++ b/Project Reboot 3.0/FortInventory.cpp @@ -382,6 +382,32 @@ bool AFortInventory::RemoveItem(const FGuid& ItemGuid, bool* bShouldUpdate, int } } + /* + if (FortPlayerController) + { + if (auto Pawn = FortPlayerController->GetMyFortPawn()) + { + static auto CurrentWeaponListOffset = Pawn->GetOffset("CurrentWeaponList"); + + if (CurrentWeaponListOffset != -1) // shouldnt be possible but better safe than sorry! + { + auto& CurrentWeaponList = Pawn->Get>(CurrentWeaponListOffset); + + for (int i = 0; i < CurrentWeaponList.Num(); ++i) + { + auto Weapon = CurrentWeaponList.At(i); + + if (Weapon->GetItemEntryGuid() == ItemGuid) + { + Weapon->K2_DestroyActor(); + break; + } + } + } + } + } + */ + // todo remove from weaponlist if (bShouldUpdate) diff --git a/Project Reboot 3.0/reboot.h b/Project Reboot 3.0/reboot.h index d7cbaf1..b862778 100644 --- a/Project Reboot 3.0/reboot.h +++ b/Project Reboot 3.0/reboot.h @@ -86,6 +86,8 @@ static inline class UWorld* GetWorld() static auto GameViewportOffset = Engine->GetOffset("GameViewport"); auto GameViewport = Engine->Get(GameViewportOffset); + if (!GameViewport) return nullptr; + static auto WorldOffset = GameViewport->GetOffset("World"); return GameViewport->Get(WorldOffset);