From 1fcff2a4d2de678329b71a452c78426981ebd9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Sun, 30 Sep 2018 12:36:48 +0300 Subject: [PATCH] Fixed|All Games: Server doesn't have the DisplayMode module available --- .../common/src/hud/widgets/automapwidget.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp b/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp index a004c9828c..a4f6259332 100644 --- a/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp +++ b/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp @@ -213,7 +213,7 @@ DENG2_PIMPL(AutomapWidget) { AutomapStyle *style = nullptr; - float dpiFactor; // DisplayMode.DPI_FACTOR + float dpiFactor = 1.f; // DisplayMode.DPI_FACTOR //DGLuint lists[NUM_MAP_OBJECTLISTS]; ///< Each list contains one or more of given type of automap wi. bool needBuildLists = false; ///< @c true= force a rebuild of all lists. @@ -269,11 +269,17 @@ DENG2_PIMPL(AutomapWidget) Impl(Public *i) : Base(i) { - //de::zap(lists); - de::zap(bounds); - de::zap(viewAABB); + using namespace de; - dpiFactor = de::ScriptSystem::get().nativeModule("DisplayMode").getf("DPI_FACTOR"); + zap(bounds); + zap(viewAABB); + + auto &ds = ScriptSystem::get(); + + if (ds.nativeModuleExists("DisplayMode")) + { + dpiFactor = ds.nativeModule("DisplayMode").getf("DPI_FACTOR"); + } } ~Impl()