diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp index 6af2a54ab..fe3c39194 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp @@ -4,7 +4,6 @@ #include "KeyboardMouseInput.h" #include -#include KeyboardMouseInput g_KBMInput; @@ -126,40 +125,16 @@ void KeyboardMouseInput::Tick() } } - #ifdef _WINDOWS64 - if (!IsGameInFront()) - { - ClipCursor(NULL); - while (ShowCursor(TRUE) < 0) {} - } - else if (m_cursorHiddenForUI) - { - ClipCursor(NULL); - } - else if (m_mouseGrabbed && g_hWnd) - { - ClipCursorToWindow(g_hWnd); - - RECT rc; - GetClientRect(g_hWnd, &rc); - POINT center; - center.x = (rc.right - rc.left) / 2; - center.y = (rc.bottom - rc.top) / 2; - ClientToScreen(g_hWnd, ¢er); - SetCursorPos(center.x, center.y); - } - #else - if ((m_mouseGrabbed || m_cursorHiddenForUI) && g_hWnd) - { - RECT rc; - GetClientRect(g_hWnd, &rc); - POINT center; - center.x = (rc.right - rc.left) / 2; - center.y = (rc.bottom - rc.top) / 2; - ClientToScreen(g_hWnd, ¢er); - SetCursorPos(center.x, center.y); - } - #endif + if ((m_mouseGrabbed || m_cursorHiddenForUI) && g_hWnd) + { + RECT rc; + GetClientRect(g_hWnd, &rc); + POINT center; + center.x = (rc.right - rc.left) / 2; + center.y = (rc.bottom - rc.top) / 2; + ClientToScreen(g_hWnd, ¢er); + SetCursorPos(center.x, center.y); + } } void KeyboardMouseInput::OnKeyDown(int vkCode) @@ -433,10 +408,4 @@ void KeyboardMouseInput::ClearCharBuffer() m_charBufferTail = 0; } -bool KeyboardMouseInput::IsGameInFront() -{ - HWND InFrontWindow = GetForegroundWindow(); - return (InFrontWindow == g_hWnd); -} - #endif // _WINDOWS64 diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.h b/Minecraft.Client/Windows64/KeyboardMouseInput.h index f59d9fe08..fff924bfd 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.h +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h @@ -139,8 +139,6 @@ private: wchar_t m_charBuffer[CHAR_BUFFER_SIZE]; int m_charBufferHead; int m_charBufferTail; - - bool IsGameInFront(); }; extern KeyboardMouseInput g_KBMInput; diff --git a/Minecraft.World/StemTile.cpp b/Minecraft.World/StemTile.cpp index bf9b058d1..545c59384 100644 --- a/Minecraft.World/StemTile.cpp +++ b/Minecraft.World/StemTile.cpp @@ -187,10 +187,11 @@ void StemTile::spawnResources(Level *level, int x, int y, int z, int data, float Item *seed = NULL; if (fruit == Tile::pumpkin) seed = Item::seeds_pumpkin; if (fruit == Tile::melon) seed = Item::seeds_melon; - for (int i = 0; i < 3; i++) - { - popResource(level, x, y, z, shared_ptr(new ItemInstance(seed))); - } + if (seed != NULL) + { + popResource(level, x, y, z, shared_ptr(new ItemInstance(seed))); + //test + } } int StemTile::getResource(int data, Random *random, int playerBonusLevel)