Added rhino turret sync, added DevTool

This commit is contained in:
Sardelka
2022-05-26 17:11:37 +08:00
parent f1182dc557
commit f9d28bb5c0
7 changed files with 97 additions and 36 deletions

View File

@ -19,10 +19,22 @@ namespace RageCoop.Client
var shooter = EntityPool.GetPedByHandle(p.Owner.Handle);
if(shooter != null)
{
Main.Logger.Warning($"Could not find owner for projectile, owner handle:{}");
ShooterID=shooter.ID;
}
else
{
// Owner will be the vehicle if projectile is shot with a vehicle
var shooterVeh = EntityPool.GetVehicleByHandle(p.Owner.Handle);
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}");
}
}
}
public SyncedProjectile(int id)
{