From 98c279c10b5a1308ab3afbef14b17d457e6bf3b8 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Thu, 26 Jul 2012 03:19:22 -0300 Subject: [PATCH] Fix a stackpos bug in 9.6 --- src/otclient/creature.cpp | 2 +- src/otclient/protocolcodes.h | 3 ++- src/otclient/protocolgameparse.cpp | 8 +------- src/otclient/tile.cpp | 3 +++ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/otclient/creature.cpp b/src/otclient/creature.cpp index 26c103b6..376145a8 100644 --- a/src/otclient/creature.cpp +++ b/src/otclient/creature.cpp @@ -41,7 +41,7 @@ Creature::Creature() : Thing() { - m_id = 1; + m_id = 0; m_healthPercent = 100; m_speed = 200; m_direction = Otc::South; diff --git a/src/otclient/protocolcodes.h b/src/otclient/protocolcodes.h index a0b3afa7..eeb4ecff 100644 --- a/src/otclient/protocolcodes.h +++ b/src/otclient/protocolcodes.h @@ -226,7 +226,8 @@ namespace Proto { ClientMarketBrowse = 245, // 944 ClientMarketCreate = 246, // 944 ClientMarketCancel = 247, // 944 - ClientMarketAccept = 248 // 944 + ClientMarketAccept = 248, // 944 + ClientAnswerModalDialog = 249 // 960 }; enum ServerSpeakType { diff --git a/src/otclient/protocolgameparse.cpp b/src/otclient/protocolgameparse.cpp index d78333b0..fa343758 100644 --- a/src/otclient/protocolgameparse.cpp +++ b/src/otclient/protocolgameparse.cpp @@ -442,13 +442,7 @@ void ProtocolGame::parseMapMoveWest(const InputMessagePtr& msg) void ProtocolGame::parseUpdateTile(const InputMessagePtr& msg) { Position tilePos = getPosition(msg); - int thingId = msg->peekU16(); - if(thingId == 0xFF01) { - msg->getU16(); - } else { - setTileDescription(msg, tilePos); - msg->getU16(); - } + setTileDescription(msg, tilePos); } void ProtocolGame::parseTileAddThing(const InputMessagePtr& msg) diff --git a/src/otclient/tile.cpp b/src/otclient/tile.cpp index 7ea34841..3d1eab11 100644 --- a/src/otclient/tile.cpp +++ b/src/otclient/tile.cpp @@ -163,6 +163,9 @@ ThingPtr Tile::addThing(const ThingPtr& thing, int stackPos) return nullptr; } + if(stackPos == 255) + stackPos = -1; + // the items stackpos follows this order: // 0 - ground // 1 - ground borders