mirror of
https://github.com/swordbluesword/PalWorld-NetCrack.git
synced 2025-04-29 02:47:17 +09:00
Fixed infinite ammo.
Refactored SpeedHack to not speed up the entire game if you are the host. Removed code from ResetStamina that causes a crash if the player doesn't have pals out.
This commit is contained in:
parent
69e5d54b2f
commit
d5d8d55186
36
feature.cpp
36
feature.cpp
@ -253,23 +253,19 @@ void SetFullbright(bool bIsSet)
|
|||||||
//
|
//
|
||||||
void SpeedHack(float mSpeed)
|
void SpeedHack(float mSpeed)
|
||||||
{
|
{
|
||||||
UWorld* pWorld = Config.gWorld;
|
auto player_controller = Config.GetPalPlayerController();
|
||||||
if (!pWorld)
|
if (!player_controller)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ULevel* pLevel = pWorld->PersistentLevel;
|
auto acknowledged_pawn = player_controller->AcknowledgedPawn;
|
||||||
if (!pLevel)
|
|
||||||
|
if (!acknowledged_pawn)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AWorldSettings* pWorldSettings = pLevel->WorldSettings;
|
acknowledged_pawn->CustomTimeDilation = mSpeed;
|
||||||
if (!pWorldSettings)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pWorld->PersistentLevel->WorldSettings->TimeDilation = mSpeed;
|
|
||||||
|
|
||||||
// pWorldSettings->TimeDilation = mSpeed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
void SetDemiGodMode(bool bIsSet)
|
void SetDemiGodMode(bool bIsSet)
|
||||||
{
|
{
|
||||||
@ -360,24 +356,6 @@ void ResetStamina()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
pParams->ResetSP();
|
pParams->ResetSP();
|
||||||
|
|
||||||
|
|
||||||
// Reset Pal Stamina ??
|
|
||||||
TArray<APalCharacter*> outPals;
|
|
||||||
Config.GetTAllPals(&outPals);
|
|
||||||
DWORD palsSize = outPals.Count();
|
|
||||||
for (int i = 0; i < palsSize; i++)
|
|
||||||
{
|
|
||||||
APalCharacter* cPal = outPals[i];
|
|
||||||
if (!cPal || cPal->IsA(APalMonsterCharacter::StaticClass()))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
UPalCharacterParameterComponent* pPalParams = pPalCharacter->CharacterParameterComponent;
|
|
||||||
if (!pPalParams)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pPalParams->ResetSP();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -72,8 +72,7 @@ namespace DX11_Base
|
|||||||
|
|
||||||
ImGui::Checkbox("InfStamina", &Config.IsInfStamina);
|
ImGui::Checkbox("InfStamina", &Config.IsInfStamina);
|
||||||
|
|
||||||
if (ImGui::Checkbox("InfAmmo", &Config.IsInfinAmmo))
|
ImGui::Checkbox("InfAmmo", &Config.IsInfinAmmo);
|
||||||
SetInfiniteAmmo(Config.IsInfinAmmo);
|
|
||||||
|
|
||||||
ImGui::Checkbox("Godmode", &Config.IsGodMode);
|
ImGui::Checkbox("Godmode", &Config.IsGodMode);
|
||||||
|
|
||||||
@ -789,5 +788,7 @@ namespace DX11_Base
|
|||||||
|
|
||||||
if (Config.IsGodMode)
|
if (Config.IsGodMode)
|
||||||
SetPlayerHealth(INT_MAX);
|
SetPlayerHealth(INT_MAX);
|
||||||
|
|
||||||
|
SetInfiniteAmmo(Config.IsInfinAmmo);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user