Explorar o código

Merge pull request #1131 from reven86/next-clean

Bugfixes
Sean Paul Taylor %!s(int64=12) %!d(string=hai) anos
pai
achega
4f8cf3154f
Modificáronse 2 ficheiros con 5 adicións e 3 borrados
  1. 3 2
      gameplay/src/Container.cpp
  2. 2 1
      gameplay/src/Logger.cpp

+ 3 - 2
gameplay/src/Container.cpp

@@ -295,8 +295,8 @@ void Container::removeControl(unsigned int index)
     GP_ASSERT(index < _controls.size());
 
     std::vector<Control*>::iterator it = _controls.begin() + index;
-    _controls.erase(it);
     Control* control = *it;
+    _controls.erase(it);
     control->_parent = NULL;
     SAFE_RELEASE(control);
 }
@@ -916,7 +916,8 @@ bool Container::moveFocus(Direction direction, Control* outsideControl)
         for (itt = _controls.begin(); itt < _controls.end(); itt++)
         {
             Control* nextControl = *itt;
-            if (nextControl->getFocusIndex() == focusIndex)
+            if (nextControl->getFocusIndex() == focusIndex &&
+                nextControl->isEnabled() && nextControl->isVisible())
             {
                 next = nextControl;
                 break;

+ 2 - 1
gameplay/src/Logger.cpp

@@ -1,3 +1,4 @@
+
 #include "Base.h"
 #include "Game.h"
 #include "ScriptController.h"
@@ -66,7 +67,7 @@ void Logger::log(Level level, const char* message, ...)
     else
     {
         // Log to the default output
-        gameplay::print(str);
+        gameplay::print("%s", str);
     }
 
     va_end(args);