mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
fix 19.10 teams + issue with picking up
This commit is contained in:
@@ -61,7 +61,10 @@ AFortPickup* AFortPickup::SpawnPickup(UFortItemDefinition* ItemDef, FVector Loca
|
|||||||
|
|
||||||
char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
||||||
{
|
{
|
||||||
// LOG_INFO(LogDev, "Woah!");
|
constexpr bool bTestPrinting = false; // we could just use our own logger but eh
|
||||||
|
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "CompletePickupAnimationHook!");
|
||||||
|
|
||||||
auto Pawn = Cast<AFortPlayerPawn>(Pickup->GetPickupLocationData()->GetPickupTarget());
|
auto Pawn = Cast<AFortPlayerPawn>(Pickup->GetPickupLocationData()->GetPickupTarget());
|
||||||
|
|
||||||
@@ -92,10 +95,10 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
|
|
||||||
auto ItemInstanceToSwap = WorldInventory->FindItemInstance(CurrentItemGuid);
|
auto ItemInstanceToSwap = WorldInventory->FindItemInstance(CurrentItemGuid);
|
||||||
|
|
||||||
if (!ItemInstanceToSwap)
|
// if (!ItemInstanceToSwap)
|
||||||
return CompletePickupAnimationOriginal(Pickup);
|
// return CompletePickupAnimationOriginal(Pickup);
|
||||||
|
|
||||||
auto ItemEntryToSwap = ItemInstanceToSwap->GetItemEntry();
|
auto ItemEntryToSwap = ItemInstanceToSwap ? ItemInstanceToSwap->GetItemEntry() : nullptr;
|
||||||
auto ItemDefinitionToSwap = ItemEntryToSwap ? Cast<UFortWorldItemDefinition>(ItemEntryToSwap->GetItemDefinition()) : nullptr;
|
auto ItemDefinitionToSwap = ItemEntryToSwap ? Cast<UFortWorldItemDefinition>(ItemEntryToSwap->GetItemDefinition()) : nullptr;
|
||||||
bool bHasSwapped = false;
|
bool bHasSwapped = false;
|
||||||
|
|
||||||
@@ -106,6 +109,9 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
|
|
||||||
std::vector<std::pair<FFortItemEntry*, FFortItemEntry*>> PairsToMarkDirty; // vector of sets or something so no duplicates??
|
std::vector<std::pair<FFortItemEntry*, FFortItemEntry*>> PairsToMarkDirty; // vector of sets or something so no duplicates??
|
||||||
|
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "Start cpyCount: {}", cpyCount);
|
||||||
|
|
||||||
bool bForceOverflow = false;
|
bool bForceOverflow = false;
|
||||||
|
|
||||||
while (cpyCount > 0)
|
while (cpyCount > 0)
|
||||||
@@ -126,6 +132,8 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
PrimarySlotsFilled++;
|
PrimarySlotsFilled++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LOG_INFO(LogDev, "[{}] PrimarySlotsFilled: {}", i, PrimarySlotsFilled);
|
||||||
|
|
||||||
bIsInventoryFull = (PrimarySlotsFilled /* - 6 */) >= 5;
|
bIsInventoryFull = (PrimarySlotsFilled /* - 6 */) >= 5;
|
||||||
|
|
||||||
if (bIsInventoryFull) // probs shouldnt do in loop but alr
|
if (bIsInventoryFull) // probs shouldnt do in loop but alr
|
||||||
@@ -139,12 +147,18 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
|
|
||||||
bHasSwapped = true;
|
bHasSwapped = true;
|
||||||
|
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "[{}] Swapping: {}", i, ItemDefinitionToSwap->GetFullName());
|
||||||
|
|
||||||
continue; // ???
|
continue; // ???
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CurrentItemEntry->GetItemDefinition() == PickupItemDefinition)
|
if (CurrentItemEntry->GetItemDefinition() == PickupItemDefinition)
|
||||||
{
|
{
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "[{}] Found stack of item!", i);
|
||||||
|
|
||||||
if (CurrentItemEntry->GetCount() < PickupItemDefinition->GetMaxStackSize())
|
if (CurrentItemEntry->GetCount() < PickupItemDefinition->GetMaxStackSize())
|
||||||
{
|
{
|
||||||
int OverStack = CurrentItemEntry->GetCount() + cpyCount - PickupItemDefinition->GetMaxStackSize();
|
int OverStack = CurrentItemEntry->GetCount() + cpyCount - PickupItemDefinition->GetMaxStackSize();
|
||||||
@@ -158,6 +172,9 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
|
|
||||||
bEverStacked = true;
|
bEverStacked = true;
|
||||||
|
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "[{}] We are stacking {}.", i, AmountToStack);
|
||||||
|
|
||||||
// if (cpyCount > 0)
|
// if (cpyCount > 0)
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
@@ -167,6 +184,9 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
|
|
||||||
if ((bIsInventoryFull || bForceOverflow) && cpyCount > 0) // overflow
|
if ((bIsInventoryFull || bForceOverflow) && cpyCount > 0) // overflow
|
||||||
{
|
{
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "[{}] Overflow", i);
|
||||||
|
|
||||||
UFortWorldItemDefinition* ItemDefinitionToSpawn = PickupItemDefinition;
|
UFortWorldItemDefinition* ItemDefinitionToSpawn = PickupItemDefinition;
|
||||||
int AmountToSpawn = cpyCount > PickupItemDefinition->GetMaxStackSize() ? PickupItemDefinition->GetMaxStackSize() : cpyCount;
|
int AmountToSpawn = cpyCount > PickupItemDefinition->GetMaxStackSize() ? PickupItemDefinition->GetMaxStackSize() : cpyCount;
|
||||||
|
|
||||||
@@ -181,6 +201,9 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
|
|
||||||
if (cpyCount > 0 && !bIsInventoryFull)
|
if (cpyCount > 0 && !bIsInventoryFull)
|
||||||
{
|
{
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "Attempting to add to inventory.");
|
||||||
|
|
||||||
if (bDoesStackExist ? PickupItemDefinition->DoesAllowMultipleStacks() : true)
|
if (bDoesStackExist ? PickupItemDefinition->DoesAllowMultipleStacks() : true)
|
||||||
{
|
{
|
||||||
auto NewItemCount = cpyCount > PickupItemDefinition->GetMaxStackSize() ? PickupItemDefinition->GetMaxStackSize() : cpyCount;
|
auto NewItemCount = cpyCount > PickupItemDefinition->GetMaxStackSize() ? PickupItemDefinition->GetMaxStackSize() : cpyCount;
|
||||||
@@ -188,6 +211,9 @@ char AFortPickup::CompletePickupAnimationHook(AFortPickup* Pickup)
|
|||||||
auto NewItem = WorldInventory->AddItem(PickupItemDefinition, nullptr,
|
auto NewItem = WorldInventory->AddItem(PickupItemDefinition, nullptr,
|
||||||
NewItemCount, PickupEntry->GetLoadedAmmo(), true);
|
NewItemCount, PickupEntry->GetLoadedAmmo(), true);
|
||||||
|
|
||||||
|
if constexpr (bTestPrinting)
|
||||||
|
LOG_INFO(LogDev, "Added item with count {} to inventory.", NewItemCount);
|
||||||
|
|
||||||
// if (NewItem)
|
// if (NewItem)
|
||||||
cpyCount -= NewItemCount;
|
cpyCount -= NewItemCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -985,19 +985,22 @@ static inline uint64 FindPickTeam()
|
|||||||
{
|
{
|
||||||
if (Engine_Version == 426)
|
if (Engine_Version == 426)
|
||||||
{
|
{
|
||||||
auto testAddr = Memcury::Scanner::FindPattern("88 54 24 10 53 56 41 54 41 55 41 56 48 83 EC 60 4C 8B A1").Get(); // 14.60 ????
|
auto testAddr = Memcury::Scanner::FindPattern("88 54 24 10 53 56 41 54 41 55 41 56 48 83 EC 60 4C 8B A1").Get(); // 14.60 what is happening lol ????
|
||||||
|
|
||||||
if (testAddr)
|
if (testAddr)
|
||||||
return testAddr;
|
return testAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (Engine_Version == 500)
|
||||||
|
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 88 54 24 10 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 70 45 33 ED 4D").Get(); // 19.10
|
||||||
|
|
||||||
else if (Engine_Version >= 427) // different start
|
else if (Engine_Version >= 427) // different start
|
||||||
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 88 54 24 10 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 70 4C 8B A1").Get();
|
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 88 54 24 10 55 56 57 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 70 4C 8B A1").Get();
|
||||||
|
|
||||||
auto Addr = Memcury::Scanner::FindStringRef(L"PickTeam for [%s] used beacon value [%d]", false);
|
auto Addr = Memcury::Scanner::FindStringRef(L"PickTeam for [%s] used beacon value [%d]", false, 0, Engine_Version >= 427); // todo check if its just s18+ but this doesn't matter for now cuz we hardcode sig
|
||||||
|
|
||||||
if (!Addr.Get())
|
if (!Addr.Get())
|
||||||
Addr = Memcury::Scanner::FindStringRef(L"PickTeam for [%s] used beacon value [%s]");
|
Addr = Memcury::Scanner::FindStringRef(L"PickTeam for [%s] used beacon value [%s]"); // i don't even know what version this is
|
||||||
|
|
||||||
return FindBytes(Addr, Fortnite_Version <= 2.5 ? std::vector<uint8_t>{ 0x48, 0x89, 0x6C } : std::vector<uint8_t>{ 0x40, 0x55 }, 1000, 0, true);
|
return FindBytes(Addr, Fortnite_Version <= 2.5 ? std::vector<uint8_t>{ 0x48, 0x89, 0x6C } : std::vector<uint8_t>{ 0x40, 0x55 }, 1000, 0, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ inline __int64 GetFunctionIdxOrPtr(UFunction* Function)
|
|||||||
|
|
||||||
if ((*(uint8_t*)(NativeAddr + i) == 0x41 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF)) // wtf ue500
|
if ((*(uint8_t*)(NativeAddr + i) == 0x41 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF)) // wtf ue500
|
||||||
{
|
{
|
||||||
LOG_INFO(LogDev, "Uhhhhhh report this to milxnor if u not on 19.10 {}", Function->GetName());
|
LOG_INFO(LogDev, "Uhhhhhh report this to milxnor if u not on 18.40+ {}", Function->GetName());
|
||||||
bFoundValidate = true;
|
bFoundValidate = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -347,6 +347,8 @@ static UObject* GetPlaylistToUse()
|
|||||||
// Playlist = FindObject("/MoleGame/Playlists/Playlist_MoleGame.Playlist_MoleGame");
|
// Playlist = FindObject("/MoleGame/Playlists/Playlist_MoleGame.Playlist_MoleGame");
|
||||||
// Playlist = FindObject("/Game/Athena/Playlists/DADBRO/Playlist_DADBRO_Squads_8.Playlist_DADBRO_Squads_8");
|
// Playlist = FindObject("/Game/Athena/Playlists/DADBRO/Playlist_DADBRO_Squads_8.Playlist_DADBRO_Squads_8");
|
||||||
|
|
||||||
|
Playlist = FindObject("/Game/Athena/Playlists/Playlist_DefaultDuo.Playlist_DefaultDuo");
|
||||||
|
|
||||||
if (Globals::bCreative)
|
if (Globals::bCreative)
|
||||||
Playlist = FindObject("/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2");
|
Playlist = FindObject("/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user