Tiny fix for movePixels
This commit is contained in:
parent
ece6507df2
commit
b5c3b37b3c
|
@ -463,6 +463,7 @@ void Client::registerLuaFunctions()
|
||||||
g_lua.bindClassMemberFunction<Item>("getCount", &Item::getCount);
|
g_lua.bindClassMemberFunction<Item>("getCount", &Item::getCount);
|
||||||
g_lua.bindClassMemberFunction<Item>("getSubType", &Item::getSubType);
|
g_lua.bindClassMemberFunction<Item>("getSubType", &Item::getSubType);
|
||||||
g_lua.bindClassMemberFunction<Item>("getId", &Item::getId);
|
g_lua.bindClassMemberFunction<Item>("getId", &Item::getId);
|
||||||
|
g_lua.bindClassMemberFunction<Item>("getServerId", &Item::getServerId);
|
||||||
g_lua.bindClassMemberFunction<Item>("getName", &Item::getName);
|
g_lua.bindClassMemberFunction<Item>("getName", &Item::getName);
|
||||||
g_lua.bindClassMemberFunction<Item>("isStackable", &Item::isStackable);
|
g_lua.bindClassMemberFunction<Item>("isStackable", &Item::isStackable);
|
||||||
g_lua.bindClassMemberFunction<Item>("isMarketable", &Item::isMarketable);
|
g_lua.bindClassMemberFunction<Item>("isMarketable", &Item::isMarketable);
|
||||||
|
|
|
@ -566,8 +566,29 @@ Position MapView::getPosition(const Point& point, const Size& mapSize)
|
||||||
|
|
||||||
void MapView::move(int x, int y)
|
void MapView::move(int x, int y)
|
||||||
{
|
{
|
||||||
m_moveOffset.x += x;
|
if(m_moveOffset.x + x > 32) {
|
||||||
m_moveOffset.y += y;
|
m_customCameraPosition.x += 1;
|
||||||
|
m_moveOffset.x = x;
|
||||||
|
requestVisibleTilesCacheUpdate();
|
||||||
|
} else if(m_moveOffset.x - x < -32) {
|
||||||
|
m_customCameraPosition.x -= 1;
|
||||||
|
m_moveOffset.x = x;
|
||||||
|
requestVisibleTilesCacheUpdate();
|
||||||
|
} else
|
||||||
|
m_moveOffset.x += x;
|
||||||
|
|
||||||
|
if(m_moveOffset.y + y > 32) {
|
||||||
|
m_customCameraPosition.y += 1;
|
||||||
|
m_moveOffset.y = y;
|
||||||
|
requestVisibleTilesCacheUpdate();
|
||||||
|
} else if(m_moveOffset.y - y < -32) {
|
||||||
|
m_customCameraPosition.y -= 1;
|
||||||
|
m_moveOffset.y = y;
|
||||||
|
requestVisibleTilesCacheUpdate();
|
||||||
|
} else
|
||||||
|
m_moveOffset.y += y;
|
||||||
|
|
||||||
|
g_logger.warning(stdext::format("move offset %d %d", m_moveOffset.x, m_moveOffset.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect MapView::calcFramebufferSource(const Size& destSize)
|
Rect MapView::calcFramebufferSource(const Size& destSize)
|
||||||
|
|
Loading…
Reference in New Issue