continue Gangwar System

This commit is contained in:
Lukas Moungos
2019-11-30 18:54:11 +01:00
parent e3dbf7c4e1
commit a4303a1a01
14 changed files with 1904 additions and 6 deletions

View File

@@ -723,8 +723,15 @@ namespace ReallifeGamemode.Server.Managers
Vector3 lastPosition = v.Position;
if (lastPositions.ContainsKey(v.Handle)) lastPosition = lastPositions[v.Handle];
lastPositions[v.Handle] = v.Position;
double distanceDriven = v.HasSharedData("drivenDistance") ? (double)v.GetSharedData("drivenDistance") : 0D;
double distanceDriven;
try
{
distanceDriven = v.HasSharedData("drivenDistance") ? (double)v.GetSharedData("drivenDistance") : 0D;
}
catch(Microsoft.CSharp.RuntimeBinder.RuntimeBinderException ex)
{
distanceDriven = (double)0;
}
double distance = lastPosition.DistanceTo(v.Position) / 1000.0;
if (distance > 0.2) return;