fix protocol 860 death, fix progress bar

master
Eduardo Bart 13 years ago
parent 0e88b03693
commit dba03d69f6

@ -4,13 +4,16 @@ function UIProgressBar.create()
local progressbar = UIProgressBar.internalCreate() local progressbar = UIProgressBar.internalCreate()
progressbar:setFocusable(false) progressbar:setFocusable(false)
progressbar:setPhantom(true) progressbar:setPhantom(true)
progressbar.percent = 100 progressbar.percent = 0
progressbar:setBackgroundSize({width = 1, height = 1})
return progressbar return progressbar
end end
function UIProgressBar:setPercent(percent) function UIProgressBar:setPercent(percent)
self:setBackgroundHeight(self:getHeight()) self:setBackgroundHeight(self:getHeight())
self:setBackgroundWidth((percent * self:getWidth())/100) local width = (percent * self:getWidth())/100
if width == 0 then width = 1 end
self:setBackgroundWidth(width)
self.percent = percent self.percent = percent
end end

@ -66,6 +66,7 @@ void Game::processLoginError(const std::string& error)
void Game::processConnectionError(const boost::system::error_code& error) void Game::processConnectionError(const boost::system::error_code& error)
{ {
// connection errors only have meaning if we still have a protocol // connection errors only have meaning if we still have a protocol
dump << "disconnected: connection error = " << error.message();
if(m_protocolGame) { if(m_protocolGame) {
if(error != asio::error::eof) if(error != asio::error::eof)
g_lua.callGlobalField("Game", "onConnectionError", error.message()); g_lua.callGlobalField("Game", "onConnectionError", error.message());

@ -307,7 +307,9 @@ void ProtocolGame::parsePing(InputMessage&)
void ProtocolGame::parseDeath(InputMessage& msg) void ProtocolGame::parseDeath(InputMessage& msg)
{ {
#if PROTOCOL==862
msg.getU8(); // 100 is a fair death. < 100 is a unfair death. msg.getU8(); // 100 is a fair death. < 100 is a unfair death.
#endif
g_game.processDeath(); g_game.processDeath();
} }

Loading…
Cancel
Save