public override IEnumerator Process() { if (SentByPlayer == ConnectedPlayer.Invalid) { //Failfast Logger.LogWarning($"Shoot request invalid, processing stopped: {ToString()}", Category.Firearms); yield break; } //get the currently equipped weapon in the player's active hand PlayerNetworkActions pna = SentByPlayer.Script.playerNetworkActions; Weapon wep = pna.GetActiveHandItem().GetComponent <Weapon>(); wep.ServerShoot(pna.gameObject, Target, DamageZone, IsSuicideShot); yield return(null); }
public override IEnumerator Process() { if (SentBy.Equals(NetworkInstanceId.Invalid)) { //Failfast Logger.LogWarning($"Shoot request invalid, processing stopped: {ToString()}", Category.Firearms); yield break; } yield return(WaitFor(SentBy)); //get the currently equipped weapon in the player's active hand PlayerNetworkActions pna = NetworkObject.GetComponent <PlayerNetworkActions>(); Weapon wep = pna.GetActiveHandItem().GetComponent <Weapon>(); wep.ServerShoot(NetworkObject, Target, DamageZone, IsSuicideShot); }