Better projectile check

This commit is contained in:
Sardelka
2022-07-14 15:28:03 +08:00
parent a37e8869ac
commit 2a29011015
2 changed files with 14 additions and 2 deletions

View File

@ -190,7 +190,7 @@ namespace RageCoop.Client {
case 1638077257:
weaponHash=(uint)VehicleWeaponHash.PlayerLazer;
break;
case (uint)VehicleWeaponHash.PlayerBuzzard:
weaponHash=1176362416;
break ;

View File

@ -209,9 +209,14 @@ namespace RageCoop.Client
public static bool IsUsingProjectileWeapon(this Ped p)
{
var vp = p.VehicleWeapon;
var type = Function.Call<int>(Hash.GET_WEAPON_DAMAGE_TYPE, vp);
if (vp!=VehicleWeaponHash.Invalid)
{
return VehicleProjectileWeapons.Contains(vp);
if(type==3)
{
return false;
}
return VehicleProjectileWeapons.Contains(vp) || (type==5 && !ExplosiveBullets.Contains((uint)vp));
}
else
{
@ -219,6 +224,13 @@ namespace RageCoop.Client
return w.Group==WeaponGroup.Thrown || ProjectileWeapons.Contains(w.Hash);
}
}
public static readonly HashSet<uint> ExplosiveBullets = new HashSet<uint>
{
(uint)VehicleWeaponHash.PlayerLazer,
(uint)WeaponHash.Railgun,
1638077257
};
public static readonly Dictionary<WeaponHash, int> MuzzleBoneIndexes = new Dictionary<WeaponHash, int>
{