Added map improvements, begin tuning sync for turbo and headlights, fix error on disconnect when crash

This commit is contained in:
hydrant
2018-12-08 21:48:58 +01:00
parent d3f026630a
commit ee183d8d2d
8 changed files with 19 additions and 15 deletions

View File

@@ -36,19 +36,17 @@ namespace reallife_gamemode.Server.Events
using (var saveUser = new Model.DatabaseContext())
{
var user = player.GetUser(saveUser);
Vector3 pos = player.Position;
if(user == null)
if(!float.IsNaN(pos.X) && !float.IsNaN(pos.Y) && !float.IsNaN(pos.Z))
{
return;
}
else
{
user.PositionX = player.Position.X;
user.PositionY = player.Position.Y;
user.PositionZ = player.Position.Z;
user.Dead = player.GetData("isDead");
user.PositionX = pos.X;
user.PositionY = pos.Y;
user.PositionZ = pos.Z;
saveUser.SaveChanges();
}
}
user.Dead = player.HasData("isDead") ? player.GetData("isDead") : false;
}
player.SetData("isLoggedIn", false);
}