Fix broken vehicle weapon sync when no impact is found

This commit is contained in:
Sardelka9515
2023-03-19 13:26:18 +08:00
parent feb20c47f4
commit ba8c2c741d
3 changed files with 6 additions and 4 deletions

View File

@ -53,7 +53,7 @@ namespace RageCoop.Client.Installer
{
UpdateStatus("Checking requirements");
var shvPath = Path.Combine(root, "ScriptHookV.dll");
var shvdnPath = Path.Combine(root, "ScriptHookVDotNet3.dll");
var shvdnPath = Path.Combine(root, "ScriptHookVDotNetCore.dll");
var scriptsPath = Path.Combine(root, "Scripts");
var installPath = Path.Combine(root, "RageCoop");
var legacyPath = Path.Combine(scriptsPath, "RageCoop");

View File

@ -156,10 +156,12 @@ namespace RageCoop.Client
return true;
}
var vehWeap = subject.VehicleWeapon;
// Not found, but it's shot from a vehicle
if (subject.VehicleWeapon != VehicleWeaponHash.Invalid)
if (vehWeap != VehicleWeaponHash.Invalid)
{
var b = c.GetMuzzleBone(true);
var b = c.MainPed.CurrentVehicle.GetMuzzleBone(vehWeap);
TriggerBulletShot(c, b.Position + b.ForwardVector * 200);
return true;
}