ID of the entity a character is interacting with is also sent to the client controlling the character (should fix characters dragging someone at the server's end but not at the client's, or vice versa)

This commit is contained in:
Regalis
2017-03-15 21:30:24 +02:00
parent 8d8620047d
commit 4285cdde27
4 changed files with 83 additions and 69 deletions
+9
View File
@@ -19,6 +19,8 @@ namespace Barotrauma
public readonly float Timestamp;
public readonly UInt16 ID;
public readonly Entity Interact; //the entity being interacted with
public PosInfo(Vector2 pos, Direction dir, float time)
: this(pos, dir, 0, time)
{
@@ -30,11 +32,18 @@ namespace Barotrauma
}
public PosInfo(Vector2 pos, Direction dir, UInt16 ID, float time)
: this(pos, dir, ID, time, null)
{
}
public PosInfo(Vector2 pos, Direction dir, UInt16 ID, float time, Entity interact)
{
Position = pos;
Direction = dir;
this.ID = ID;
Interact = interact;
Timestamp = time;
}