Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit aa5892e

Browse files
committed
Fix weather in XP11
1 parent ee2d74e commit aa5892e

6 files changed

Lines changed: 8 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.9)
2-
project(AviTab VERSION 0.6.1 DESCRIPTION "AviTab X-Plane plugin")
2+
project(AviTab VERSION 0.6.2 DESCRIPTION "AviTab X-Plane plugin")
33

44
if (NOT "$ENV{NAVIGRAPH_SECRET}" STREQUAL "")
55
set(NAVIGRAPH_SECRET "$ENV{NAVIGRAPH_SECRET}" CACHE INTERNAL "Copied from environment variable")

lib/cairo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit aee96d175d8349945a6d1948a56abd4b4ec6ad84

lib/litehtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit f06d139a0c35f280828ff299530474a324c7640e

lib/pixman

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 9b49f4e08751885289333fed652bf5e0f45976b4

src/environment/xplane/XPlaneEnvironment.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ XPlaneEnvironment::XPlaneEnvironment() {
4444
XPLMHostApplicationID hostId;
4545
XPLMGetVersions(&xpVersion, &xplmVersion, &hostId);
4646
if (xplmVersion >= 400) {
47-
isXP12 = true;
4847
getMetar = (GetMetarPtr) XPLMFindSymbol("XPLMGetMETARForAirport");
48+
} else {
49+
getMetar = nullptr;
4950
}
5051

5152
updatePlaneCount();
@@ -363,18 +364,14 @@ double XPlaneEnvironment::getMagneticVariation(double lat, double lon) {
363364

364365
std::string XPlaneEnvironment::getMETARForAirport(const std::string &icao) {
365366
std::string metar, timestamp;
366-
if (isXP12) {
367+
if (getMetar) {
367368
std::promise<std::string> dataPromise;
368369
auto futureData = dataPromise.get_future();
369370

370371
auto startAt = std::chrono::steady_clock::now();
371372
runInEnvironment([this, icao, &dataPromise] () {
372373
XPLMFixedString150_t buf;
373-
if (getMetar) {
374-
getMetar(icao.c_str(), &buf);
375-
} else {
376-
strcpy(buf.buffer, "XPLM Error");
377-
}
374+
getMetar(icao.c_str(), &buf);
378375
dataPromise.set_value(std::string(buf.buffer));
379376
});
380377

src/environment/xplane/XPlaneEnvironment.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class XPlaneEnvironment: public Environment {
8383
Location nullLocation { 0, 0, 0, 0 };
8484
std::atomic<float> lastDrawTime{};
8585
std::string aircraftPath;
86-
bool isXP12;
8786

8887
// State
8988
std::mutex stateMutex;

0 commit comments

Comments
 (0)