diff --git a/Assets/Scripts/Networking/Clientside/Client.cs b/Assets/Scripts/Networking/Clientside/Client.cs
index e25e54c..3aa8b36 100644
--- a/Assets/Scripts/Networking/Clientside/Client.cs
+++ b/Assets/Scripts/Networking/Clientside/Client.cs
@@ -200,8 +200,11 @@ namespace Cyber.Networking.Clientside {
case (PktType.InteractPkt):
InteractionPkt Interaction = new InteractionPkt();
Interaction.Deserialize(msg.reader);
+ if (Interaction.OwnerSyncBaseID == Player.Character.ID) {
+ break;
+ }
- SyncBase Target = Spawner.SyncDB.Get(Interaction.SyncBaseID);
+ SyncBase Target = Spawner.SyncDB.Get(Interaction.InteractSyncBaseID);
if (Target != null && Target is Interactable) {
((Interactable) Target).Interact();
} else {
diff --git a/Assets/Scripts/Networking/Messages/InteractionPkt.cs b/Assets/Scripts/Networking/Messages/InteractionPkt.cs
index 86f304e..aa1af53 100644
--- a/Assets/Scripts/Networking/Messages/InteractionPkt.cs
+++ b/Assets/Scripts/Networking/Messages/InteractionPkt.cs
@@ -11,14 +11,19 @@ namespace Cyber.Networking.Messages {
///
/// ID of the interactible.
///
- public int SyncBaseID;
+ public int InteractSyncBaseID;
+
+ ///
+ /// Id of the interactor.
+ ///
+ public int OwnerSyncBaseID;
///
/// Creates an InteraktionPkt, which contains the message "someone interacted".
///
///
public InteractionPkt(int syncBaseID) {
- SyncBaseID = syncBaseID;
+ InteractSyncBaseID = syncBaseID;
}
///
@@ -31,7 +36,8 @@ namespace Cyber.Networking.Messages {
///
///
public override void Deserialize(NetworkReader reader) {
- SyncBaseID = reader.ReadInt32();
+ InteractSyncBaseID = reader.ReadInt32();
+ OwnerSyncBaseID = reader.ReadInt32();
}
///
@@ -39,7 +45,8 @@ namespace Cyber.Networking.Messages {
///
///
public override void Serialize(NetworkWriter writer) {
- writer.Write(SyncBaseID);
+ writer.Write(InteractSyncBaseID);
+ writer.Write(OwnerSyncBaseID);
}
}
diff --git a/Assets/Scripts/Networking/Serverside/Server.cs b/Assets/Scripts/Networking/Serverside/Server.cs
index 0025704..17077a5 100644
--- a/Assets/Scripts/Networking/Serverside/Server.cs
+++ b/Assets/Scripts/Networking/Serverside/Server.cs
@@ -177,7 +177,9 @@ namespace Cyber.Networking.Serverside {
Interaction.Deserialize(msg.reader);
Character Sender = Players[msg.conn.connectionId].Character;
- SyncBase Target = Spawner.SyncDB.Get(Interaction.SyncBaseID);
+ SyncBase Target = Spawner.SyncDB.Get(Interaction.InteractSyncBaseID);
+
+ Interaction.OwnerSyncBaseID = Sender.ID;
if (Target != null && Target is Interactable) {
Interactable Interacted = (Interactable) Target;