From 087fbae5648dbbe720de6e8a5bbcaa0b0140dcbe Mon Sep 17 00:00:00 2001 From: Ryuichiro Date: Sat, 30 Jul 2016 17:24:31 +0200 Subject: [PATCH 1/2] Fixed Spawn offset --- PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj | 1 + PoGo.NecroBot.Logic/Settings.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj b/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj index e71addf56..55903874b 100644 --- a/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj +++ b/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj @@ -62,6 +62,7 @@ + diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index 8c46d349f..522383ea9 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -106,6 +106,7 @@ public class GlobalSettings public double DefaultAltitude = 10; public double DefaultLatitude = 40.785091; public double DefaultLongitude = -73.968285; + public double MaxSpawnLocationOffset = 0.0005; public int DelayBetweenPokemonCatch = 2000; public int DelayBetweenPlayerActions = 5000; public float EvolveAboveIvValue = 95; @@ -482,7 +483,7 @@ double ISettings.DefaultLatitude { get { - return _settings.DefaultLatitude + _rand.NextDouble() * (0.2 - 0.01) + 0.01; + return _settings.DefaultLatitude + _rand.NextDouble() * (_settings.MaxSpawnLocationOffset); } set @@ -495,7 +496,7 @@ double ISettings.DefaultLongitude { get { - return _settings.DefaultLongitude + _rand.NextDouble() * (0.2 - 0.01) + 0.01; + return _settings.DefaultLongitude + _rand.NextDouble() * (_settings.MaxSpawnLocationOffset); } set From 1344f3771d83028865906e57c9fe8ae66557e415 Mon Sep 17 00:00:00 2001 From: Ryuichiro Date: Sat, 30 Jul 2016 17:46:57 +0200 Subject: [PATCH 2/2] now in meter Changed unit of MaxSpawnLocationOffset in meter. NOT Acurate but good enough. --- PoGo.NecroBot.Logic/Settings.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index 8cc392252..23a8f6610 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -106,7 +106,7 @@ public class GlobalSettings public double DefaultAltitude = 10; public double DefaultLatitude = 40.785091; public double DefaultLongitude = -73.968285; - public double MaxSpawnLocationOffset = 0.0005; + public int MaxSpawnLocationOffset = 10; public int DelayBetweenPokemonCatch = 2000; public int DelayBetweenPlayerActions = 5000; public float EvolveAboveIvValue = 95; @@ -486,7 +486,7 @@ double ISettings.DefaultLatitude { get { - return _settings.DefaultLatitude + _rand.NextDouble() * (_settings.MaxSpawnLocationOffset); + return _settings.DefaultLatitude + _rand.NextDouble() * (_settings.MaxSpawnLocationOffset / 111111); } set @@ -499,7 +499,7 @@ double ISettings.DefaultLongitude { get { - return _settings.DefaultLongitude + _rand.NextDouble() * (_settings.MaxSpawnLocationOffset); + return _settings.DefaultLongitude + _rand.NextDouble() * (_settings.MaxSpawnLocationOffset / 111111 / Math.Cos(_settings.DefaultLatitude)); } set