mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
seedfix by changing spawnresources() & removing other branch pullrequest
This commit is contained in:
parent
cb6106b490
commit
896dbe8992
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "KeyboardMouseInput.h"
|
||||
#include <cmath>
|
||||
#include <windows.h>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -139,8 +139,6 @@ private:
|
|||
wchar_t m_charBuffer[CHAR_BUFFER_SIZE];
|
||||
int m_charBufferHead;
|
||||
int m_charBufferTail;
|
||||
|
||||
bool IsGameInFront();
|
||||
};
|
||||
|
||||
extern KeyboardMouseInput g_KBMInput;
|
||||
|
|
|
|||
|
|
@ -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<ItemInstance>(new ItemInstance(seed)));
|
||||
}
|
||||
if (seed != NULL)
|
||||
{
|
||||
popResource(level, x, y, z, shared_ptr<ItemInstance>(new ItemInstance(seed)));
|
||||
//test
|
||||
}
|
||||
}
|
||||
|
||||
int StemTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
|
|
|
|||
Loading…
Reference in a new issue