public static double GetProjectileSpeed(Hero unit)
{
if (unit == null || !unit.IsRanged)
{
return double.MaxValue;
}
var name = unit.StoredName();
try
{
double projSpeed;
if (!ProjSpeedDictionary.TryGetValue(unit.Handle, out projSpeed))
{
projSpeed = Game.FindKeyValues(name + "/ProjectileSpeed", KeyValueSource.Hero).IntValue;
}
return projSpeed;
}
catch (KeyValuesNotFoundException)
{
if (!Utils.SleepCheck("Ensage.Common.DemoModeWarning"))
{
return double.MaxValue;
}
Utils.Sleep(10000, "Ensage.Common.DemoModeWarning");
Console.WriteLine(@"[[Please do not use demo mode for testing assemblies]]");
return double.MaxValue;
}
}