From 9389c6564fccbe7c26440aa6e1d2c81a2556d4f7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 13 Mar 2020 16:46:54 +0000 Subject: [PATCH] Nasal geodinfo: warn when scenery is not loaded --- src/Scripting/NasalPositioned.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Scripting/NasalPositioned.cxx b/src/Scripting/NasalPositioned.cxx index 1246ad951..a78f04add 100644 --- a/src/Scripting/NasalPositioned.cxx +++ b/src/Scripting/NasalPositioned.cxx @@ -1457,8 +1457,10 @@ static naRef f_geodinfo(naContext c, naRef me, int argc, naRef* args) if (scenery == nullptr) return naNil(); - if(!scenery->get_elevation_m(geod, elev, &material)) - return naNil(); + if(!scenery->get_elevation_m(geod, elev, &material)) { + SG_LOG(SG_TERRAIN, SG_DEV_WARN, "Nasal geodinfo() querying location with no loaded tiles:" << geod); + return naNil(); + } naRef vec = naNewVector(c); naVec_append(vec, naNum(elev));