mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-15 00:37:09 +00:00
convert other TryFire() to static function
This commit is contained in:
parent
3a9b07cf7b
commit
18136f279f
1 changed files with 11 additions and 6 deletions
|
@ -418,21 +418,26 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
}
|
||||
|
||||
|
||||
protected virtual bool TryFire ()
|
||||
public static bool TryFire (Ped ped)
|
||||
{
|
||||
if (m_weapon != null)
|
||||
if (ped.CurrentWeapon != null)
|
||||
{
|
||||
if (m_isServer)
|
||||
if (Net.NetStatus.IsServer)
|
||||
{
|
||||
if (m_ped.IsControlledByLocalPlayer || null == m_ped.PlayerOwner)
|
||||
return TryFire(m_ped, m_weapon.GetFirePos(), m_weapon.GetFireDir());
|
||||
if (ped.IsControlledByLocalPlayer || null == ped.PlayerOwner)
|
||||
return TryFire(ped, ped.CurrentWeapon.GetFirePos(), ped.CurrentWeapon.GetFireDir());
|
||||
else // this ped is owned by remote client
|
||||
return TryFire(m_ped, m_ped.NetFirePos, m_ped.NetFireDir);
|
||||
return TryFire(ped, ped.NetFirePos, ped.NetFireDir);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual bool TryFire()
|
||||
{
|
||||
return TryFire(m_ped);
|
||||
}
|
||||
|
||||
public static bool TryFire (Ped ped, Vector3 firePos, Vector3 fireDir)
|
||||
{
|
||||
bool isServer = Net.NetStatus.IsServer;
|
||||
|
|
Loading…
Reference in a new issue