Parcourir la source

Merge pull request #1131 from reven86/next-clean

Bugfixes
Sean Paul Taylor il y a 12 ans
Parent
commit
4f8cf3154f
2 fichiers modifiés avec 5 ajouts et 3 suppressions
  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());
     GP_ASSERT(index < _controls.size());
 
 
     std::vector<Control*>::iterator it = _controls.begin() + index;
     std::vector<Control*>::iterator it = _controls.begin() + index;
-    _controls.erase(it);
     Control* control = *it;
     Control* control = *it;
+    _controls.erase(it);
     control->_parent = NULL;
     control->_parent = NULL;
     SAFE_RELEASE(control);
     SAFE_RELEASE(control);
 }
 }
@@ -916,7 +916,8 @@ bool Container::moveFocus(Direction direction, Control* outsideControl)
         for (itt = _controls.begin(); itt < _controls.end(); itt++)
         for (itt = _controls.begin(); itt < _controls.end(); itt++)
         {
         {
             Control* nextControl = *itt;
             Control* nextControl = *itt;
-            if (nextControl->getFocusIndex() == focusIndex)
+            if (nextControl->getFocusIndex() == focusIndex &&
+                nextControl->isEnabled() && nextControl->isVisible())
             {
             {
                 next = nextControl;
                 next = nextControl;
                 break;
                 break;

+ 2 - 1
gameplay/src/Logger.cpp

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