Added map improvements, begin tuning sync for turbo and headlights, fix error on disconnect when crash
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user