Resetting EventManager IDs when ending the round, NaN/INF check when setting camera position

This commit is contained in:
Regalis
2016-11-24 20:48:20 +02:00
parent ffb6ec2000
commit e4744e8385
3 changed files with 13 additions and 1 deletions

View File

@@ -234,7 +234,14 @@ namespace Barotrauma
public Vector2 Position
{
get { return position; }
set { position = value; }
set
{
if (!MathUtils.IsValid(value))
{
return;
}
position = value;
}
}
public Vector2 ScreenToWorld(Vector2 coords)

View File

@@ -100,6 +100,8 @@ namespace Barotrauma.Networking
public void Clear()
{
ID = 0;
events.Clear();
eventLastSent.Clear();
}

View File

@@ -96,7 +96,10 @@ namespace Barotrauma.Networking
public void Clear()
{
ID = 0;
events.Clear();
server.ConnectedClients.ForEach(c => c.entityEventLastSent.Clear());
}
}
}