Skip to content

Commit

Permalink
FC: remove code that crashes the game.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGrobbe committed Jun 6, 2018
1 parent 33f26d8 commit 7951d1a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions vMenu/FunctionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -795,15 +795,21 @@ private async Task WeaponOptions()
}

// Enable/disable infinite ammo.
SetPedInfiniteAmmoClip(PlayerPedId(), MainMenu.WeaponOptionsMenu.UnlimitedAmmo && cf.IsAllowed(Permission.WPUnlimitedAmmo));

// workaround for mk2 weapons (the infinite ammo doesn't seem to work all the time for mk2 weapons)
if (MainMenu.WeaponOptionsMenu.UnlimitedAmmo && cf.IsAllowed(Permission.WPUnlimitedAmmo) && Game.PlayerPed.Weapons.Current.IsMk2 &&
Game.PlayerPed.Weapons.Current.Ammo != Game.PlayerPed.Weapons.Current.MaxAmmo)
//SetPedInfiniteAmmoClip(PlayerPedId(), MainMenu.WeaponOptionsMenu.UnlimitedAmmo && cf.IsAllowed(Permission.WPUnlimitedAmmo));
if (Game.PlayerPed.Weapons.Current != null && Game.PlayerPed.Weapons.Current.Hash != WeaponHash.Unarmed)
{
Game.PlayerPed.Weapons.Current.Ammo = Game.PlayerPed.Weapons.Current.MaxAmmo;
Game.PlayerPed.Weapons.Current.InfiniteAmmo = MainMenu.WeaponOptionsMenu.UnlimitedAmmo && cf.IsAllowed(Permission.WPUnlimitedAmmo);
}


/// THIS SOLUTION IS BUGGED AND CAUSES CRASHES
//// workaround for mk2 weapons (the infinite ammo doesn't seem to work all the time for mk2 weapons)
//if (MainMenu.WeaponOptionsMenu.UnlimitedAmmo && cf.IsAllowed(Permission.WPUnlimitedAmmo) && Game.PlayerPed.Weapons.Current.IsMk2 &&
// Game.PlayerPed.Weapons.Current.Ammo != Game.PlayerPed.Weapons.Current.MaxAmmo)
//{
// Game.PlayerPed.Weapons.Current.Ammo = Game.PlayerPed.Weapons.Current.MaxAmmo;
//}

if (MainMenu.WeaponOptionsMenu.AutoEquipChute)
{
if ((IsPedInAnyHeli(PlayerPedId()) || IsPedInAnyPlane(PlayerPedId())) && !HasPedGotWeapon(PlayerPedId(), (uint)WeaponHash.Parachute, false))
Expand Down

0 comments on commit 7951d1a

Please sign in to comment.