Sfoglia il codice sorgente

Do not attempt to play animations when map is inactive

Ivan Savenko 2 anni fa
parent
commit
839172cd30
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      client/mapView/MapViewController.cpp

+ 7 - 0
client/mapView/MapViewController.cpp

@@ -18,6 +18,7 @@
 
 
 #include "../CPlayerInterface.h"
 #include "../CPlayerInterface.h"
 #include "../adventureMap/CAdvMapInt.h"
 #include "../adventureMap/CAdvMapInt.h"
+#include "../gui/CGuiHandler.h"
 
 
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/CPathfinder.h"
 #include "../../lib/CPathfinder.h"
@@ -206,6 +207,9 @@ bool MapViewController::isEventVisible(const CGObjectInstance * obj)
 	if(!LOCPLINT->makingTurn && settings["adventure"]["enemyMoveTime"].Float() < 0)
 	if(!LOCPLINT->makingTurn && settings["adventure"]["enemyMoveTime"].Float() < 0)
 		return false; // enemy move speed set to "hidden/none"
 		return false; // enemy move speed set to "hidden/none"
 
 
+	if(GH.topInt() != adventureInt)
+		return false;
+
 	if(obj->isVisitable())
 	if(obj->isVisitable())
 		return context->isVisible(obj->visitablePos());
 		return context->isVisible(obj->visitablePos());
 	else
 	else
@@ -220,6 +224,9 @@ bool MapViewController::isEventVisible(const CGHeroInstance * obj, const int3 &
 	if(!LOCPLINT->makingTurn && settings["adventure"]["enemyMoveTime"].Float() < 0)
 	if(!LOCPLINT->makingTurn && settings["adventure"]["enemyMoveTime"].Float() < 0)
 		return false; // enemy move speed set to "hidden/none"
 		return false; // enemy move speed set to "hidden/none"
 
 
+	if(GH.topInt() != adventureInt)
+		return false;
+
 	if(context->isVisible(obj->convertToVisitablePos(from)))
 	if(context->isVisible(obj->convertToVisitablePos(from)))
 		return true;
 		return true;