summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-28 22:33:53 +0000
committerDave Hibberd <hibby@debian.org>2024-11-28 22:33:53 +0000
commite2a62732f504cca5db8fb8d6d38ca64dfd4b92ac (patch)
treee757406df9b2efba5890c70b237d2d91380f1c89 /config.c
parent7d1deaae3884a9ca8bdba9df5c7b317171ab3b40 (diff)
New upstream version 6.0.24.51upstream/6.0.24.51
Diffstat (limited to 'config.c')
-rw-r--r--config.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/config.c b/config.c
index 6408e25..818e24d 100644
--- a/config.c
+++ b/config.c
@@ -174,11 +174,16 @@ extern BOOL Loopflag;
extern char NodeMapServer[80];
extern char ChatMapServer[80];
+double LatFromLOC;
+double LonFromLOC;
+
+
VOID * zalloc(int len);
int WritetoConsoleLocal(char * buff);
char * stristr (char *ch1, char *ch2);
+int FromLOC(char * Locator, double * pLat, double * pLon);
VOID Consoleprintf(const char * format, ...)
{
@@ -342,7 +347,7 @@ static int routine[] =
14, 14, 14, 14,
14, 14 ,14, 14,
15, 0, 2, 9, 9,
-2, 2, 2, 2, 2, 2,
+2, 2, 1, 2, 2, 2,
2, 2, 0, 1, 20, 20} ; // Routine to process param
int PARAMLIM = sizeof(routine)/sizeof(int);
@@ -924,11 +929,21 @@ NextAPRS:
strcat(LOCATOR, ":");
strcat(LOCATOR, ptr2);
ToLOC(atof(ptr1), atof(ptr2), LOC);
+ LatFromLOC = atof(ptr1);
+ LonFromLOC = atof(ptr2);
+
}
else
{
if (strlen(ptr1) == 6)
+ {
strcpy(LOC, ptr1);
+ FromLOC(LOC, &LatFromLOC, &LonFromLOC);
+ // Randomise in square
+ LatFromLOC += ((rand() / 24.0) / RAND_MAX);
+ LonFromLOC += ((rand() / 12.0) / RAND_MAX);
+
+ }
}
}
return 0;