only change driven distance of vehicle when distance is smaller than 200m (teleport distances were added to driven distance)
This commit is contained in:
@@ -691,7 +691,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
double distanceDriven = v.HasSharedData("drivenDistance") ? (double)v.GetSharedData("drivenDistance") : 0D;
|
||||
|
||||
distanceDriven += (lastPosition.DistanceTo(v.Position) / 1000.0);
|
||||
double distance = lastPosition.DistanceTo(v.Position) / 1000.0;
|
||||
if (distance > 0.2) return;
|
||||
distanceDriven += distance;
|
||||
|
||||
v.SetSharedData("drivenDistance", (float)distanceDriven);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user