fix preloaded fr

This commit is contained in:
Milxnor
2023-06-26 09:54:57 -04:00
parent a67fe1a361
commit f5dcc36957
3 changed files with 23 additions and 8 deletions

View File

@@ -206,6 +206,7 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
}
const auto& ItemInstances = WorldInventory->GetItemList().GetItemInstances();
const auto& ReplicatedEntries = WorldInventory->GetItemList().GetReplicatedEntries();
for (int i = 0; i < ItemInstances.Num(); ++i)
{
@@ -221,6 +222,18 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
WorldInventory->GetItemList().MarkItemDirty(ItemInstance->GetItemEntry());
}
for (int i = 0; i < ReplicatedEntries.Num(); ++i)
{
auto ReplicatedEntry = ReplicatedEntries.AtPtr(i, FFortItemEntry::GetStructSize());
auto WeaponItemDefinition = Cast<UFortWeaponItemDefinition>(ReplicatedEntry->GetItemDefinition());
if (!WeaponItemDefinition) continue;
ReplicatedEntry->GetLoadedAmmo() = WeaponItemDefinition->GetClipSize();
WorldInventory->GetItemList().MarkItemDirty(ReplicatedEntry);
}
WorldInventory->Update();
}
}

View File

@@ -22,8 +22,6 @@ void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMa
LOG_INFO(LogDev, "NewLateGameSafeZonePhase: {}", NewLateGameSafeZonePhase);
static bool bReversing = false;
if (Fortnite_Version < 13)
{
if (Globals::bLateGame.load())
@@ -34,7 +32,7 @@ void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMa
if (NewLateGameSafeZonePhase == EndReverseZonePhase)
{
bReversing = false;
bZoneReversing = false;
}
if (NewLateGameSafeZonePhase == 2 || NewLateGameSafeZonePhase == 3)
@@ -47,10 +45,10 @@ void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMa
if (NewLateGameSafeZonePhase >= StartReverseZonePhase) // This means instead of going to the 8th phase its gonna go down.
{
bReversing = true;
bZoneReversing = true;
}
if (bReversing && bEnableReverseZone) NewLateGameSafeZonePhase--;
if (bZoneReversing && bEnableReverseZone) NewLateGameSafeZonePhase--;
else NewLateGameSafeZonePhase++;
return;
@@ -130,15 +128,15 @@ void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMa
if (NewLateGameSafeZonePhase == EndReverseZonePhase)
{
bReversing = false;
bZoneReversing = false;
}
if (NewLateGameSafeZonePhase >= StartReverseZonePhase) // This means instead of going to the 8th phase its gonna go down.
{
bReversing = true;
bZoneReversing = true;
}
if (bReversing && bEnableReverseZone) NewLateGameSafeZonePhase--;
if (bZoneReversing && bEnableReverseZone) NewLateGameSafeZonePhase--;
else NewLateGameSafeZonePhase++;
}
else

View File

@@ -81,6 +81,7 @@ extern inline bool bDebugPrintLooting = false;
extern inline bool bDebugPrintFloorLoot = false;
extern inline bool bDebugPrintSwapping = false;
extern inline bool bEnableBotTick = false;
extern inline bool bZoneReversing = false;
extern inline bool bEnableCombinePickup = false;
extern inline int AmountOfBotsToSpawn = 0;
extern inline bool bEnableRebooting = false;
@@ -1166,6 +1167,9 @@ static inline void MainUI()
}
else if (Tab == LATEGAME_TAB)
{
if (bEnableReverseZone)
ImGui::Text(std::format("Currently {}eversing zone", bZoneReversing ? "r" : "not r").c_str());
ImGui::Checkbox("Enable Reverse Zone (EXPERIMENTAL)", &bEnableReverseZone);
if (bEnableReverseZone)