Finally bots can die. Player to. And another fixes.

This commit is contained in:
2022-05-17 00:21:53 +07:00
parent 06fdfc077c
commit 229c4490c4
15 changed files with 160 additions and 171 deletions

View File

@ -47,16 +47,15 @@ public class MapManager : MonoBehaviour
var startNavPoint = _instance.IDToNavPoint[startPoint];
var endNavPoint = _instance.IDToNavPoint[endPoint];
float coef;
try
if (allDistance != 0)
{
coef = remainingDistance / allDistance;
startNavPoint.DeathAttr += 1 - coef;
endNavPoint.DeathAttr += coef;
}
catch (System.ArithmeticException)
else
{
Debug.LogError("Path Length is zero");
return;
startNavPoint.DeathAttr += 1;
}
startNavPoint.DeathAttr += 1 - coef;
endNavPoint.DeathAttr += coef;
}
}