Projectile and stromberg fix.

This commit is contained in:
Sardelka 2022-06-02 12:44:05 +08:00
parent e2d4ce2159
commit c941ca96fc
3 changed files with 7 additions and 7 deletions

View File

@ -16,7 +16,7 @@ namespace RageCoop.Client
IsMine=true;
MainProjectile = p;
Origin=p.Position;
var shooter = EntityPool.GetPedByHandle(p.Owner.Handle);
var shooter = EntityPool.GetPedByHandle((p.Owner?.Handle).GetValueOrDefault());
if(shooter != null)
{
ShooterID=shooter.ID;
@ -24,14 +24,14 @@ namespace RageCoop.Client
else
{
// Owner will be the vehicle if projectile is shot with a vehicle
var shooterVeh = EntityPool.GetVehicleByHandle(p.Owner.Handle);
var shooterVeh = EntityPool.GetVehicleByHandle((p.Owner?.Handle).GetValueOrDefault());
if (shooterVeh!=null && shooterVeh.MainVehicle.Driver!=null)
{
ShooterID=shooterVeh.MainVehicle.Driver.GetSyncEntity().ID;
}
else
{
Main.Logger.Warning($"Could not find owner for projectile, owner handle:{p.Owner.Handle}");
Main.Logger.Warning($"Could not find owner for projectile:{Hash}");
}
}

View File

@ -12,7 +12,6 @@ using System.Threading;
namespace RageCoop.Client {
internal static class SyncEvents
{
#region TRIGGER
public static void TriggerPedKilled(SyncedPed victim)
{
@ -161,16 +160,16 @@ namespace RageCoop.Client {
{
// Minigun, not working for some reason
case (uint)WeaponHash.Minigun:
weaponHash=(uint)WeaponHash.HeavyRifle;
weaponHash=1176362416;
break;
// Valkyire, not working for some reason
case 2756787765:
weaponHash=(uint)WeaponHash.HeavyRifle;
weaponHash=1176362416;
break;
case (uint)VehicleWeaponHash.PlayerBuzzard:
weaponHash=(uint)WeaponHash.HeavyRifle;
weaponHash=1176362416;
break ;
}

View File

@ -235,6 +235,7 @@ namespace RageCoop.Client
VehicleWeaponHash.PlaneRocket,
VehicleWeaponHash.SpaceRocket,
VehicleWeaponHash.Tank,
(VehicleWeaponHash)3565779982 // STROMBERG missiles (homing off)
};
}
}