Skip to content

Commit

Permalink
WIP Allow pinging when moving
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 6, 2024
1 parent 5048f81 commit 2fe957d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Fika.Core/Coop/PacketHandlers/ClientPacketSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using LiteNetLib.Utils;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace Fika.Core.Coop.PacketHandlers
Expand Down Expand Up @@ -121,7 +122,11 @@ private void Update()
Client?.SendData(Writer, ref healthSyncPacket, DeliveryMethod.ReliableOrdered);
}
}
if (FikaPlugin.PingButton.Value.IsPressed() && player.IsYourPlayer && player.HealthController.IsAlive && FikaPlugin.UsePingSystem.Value)
if (Input.GetKey(FikaPlugin.PingButton.Value.MainKey)
&& FikaPlugin.PingButton.Value.Modifiers.All(Input.GetKey)
&& player.IsYourPlayer
&& player.HealthController.IsAlive
&& FikaPlugin.UsePingSystem.Value)
{
player?.Ping();
}
Expand Down
7 changes: 6 additions & 1 deletion Fika.Core/Coop/PacketHandlers/ServerPacketSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace Fika.Core.Coop.PacketHandlers
Expand Down Expand Up @@ -128,7 +129,11 @@ private void Update()
Server?.SendDataToAll(Writer, ref healthSyncPacket, DeliveryMethod.ReliableOrdered);
}
}
if (FikaPlugin.PingButton.Value.IsPressed() && player.IsYourPlayer && player.HealthController.IsAlive && FikaPlugin.UsePingSystem.Value)
if (Input.GetKey(FikaPlugin.PingButton.Value.MainKey)
&& FikaPlugin.PingButton.Value.Modifiers.All(Input.GetKey)
&& player.IsYourPlayer
&& player.HealthController.IsAlive
&& FikaPlugin.UsePingSystem.Value)
{
player?.Ping();
}
Expand Down

0 comments on commit 2fe957d

Please sign in to comment.