From 839172cd301250d50f8bbc39f2ead2de2937be2b Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Fri, 31 Mar 2023 20:00:54 +0300 Subject: [PATCH] Do not attempt to play animations when map is inactive --- client/mapView/MapViewController.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/mapView/MapViewController.cpp b/client/mapView/MapViewController.cpp index 66427114d..2f0fd06bd 100644 --- a/client/mapView/MapViewController.cpp +++ b/client/mapView/MapViewController.cpp @@ -18,6 +18,7 @@ #include "../CPlayerInterface.h" #include "../adventureMap/CAdvMapInt.h" +#include "../gui/CGuiHandler.h" #include "../../lib/CConfigHandler.h" #include "../../lib/CPathfinder.h" @@ -206,6 +207,9 @@ bool MapViewController::isEventVisible(const CGObjectInstance * obj) if(!LOCPLINT->makingTurn && settings["adventure"]["enemyMoveTime"].Float() < 0) return false; // enemy move speed set to "hidden/none" + if(GH.topInt() != adventureInt) + return false; + if(obj->isVisitable()) return context->isVisible(obj->visitablePos()); else @@ -220,6 +224,9 @@ bool MapViewController::isEventVisible(const CGHeroInstance * obj, const int3 & if(!LOCPLINT->makingTurn && settings["adventure"]["enemyMoveTime"].Float() < 0) return false; // enemy move speed set to "hidden/none" + if(GH.topInt() != adventureInt) + return false; + if(context->isVisible(obj->convertToVisitablePos(from))) return true;