Minor fixes

* Fix auto openning channels with id 0 (guild chats)
* Minor fix in print
* Fix use of items behind creatures with classic control
* Fix teleports of 1sqm
master
Eduardo Bart 12 years ago
parent 5de031fb8b
commit 7c48a98b67

@ -3,7 +3,7 @@
function print(...) function print(...)
local msg = "" local msg = ""
for i,v in ipairs({...}) do for i,v in ipairs({...}) do
msg = msg .. tostring(v) .. "\t" msg = msg .. tostring(v) .. " "
end end
g_logger.log(LogInfo, msg) g_logger.log(LogInfo, msg)
end end

@ -388,7 +388,7 @@ function popupMenu(mousePos, mouseButton, creatureName, text)
if creatureName then if creatureName then
if creatureName ~= g_game.getCharacterName() then if creatureName ~= g_game.getCharacterName() then
menu:addOption(tr('Message to ' .. creatureName), function () g_game.openPrivateChannel(creatureName) end) menu:addOption(tr('Message to ' .. creatureName), function () g_game.openPrivateChannel(creatureName) end)
if (not Player:hasVip(creatureName)) then if not g_game.getLocalPlayer():hasVip(creatureName) then
menu:addOption(tr('Add to VIP list'), function () g_game.addVip(creatureName) end) menu:addOption(tr('Add to VIP list'), function () g_game.addVip(creatureName) end)
end end
-- TODO ignore creatureName -- TODO ignore creatureName
@ -599,7 +599,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
if channel then if channel then
addText(composedMessage, speaktype, channel, name) addText(composedMessage, speaktype, channel, name)
elseif channelId ~= 0 then else
-- server sent a message on a channel that is not open -- server sent a message on a channel that is not open
pwarning('message in channel id ' .. channelId .. ' which is unknown, this is a server bug, relogin if you want to see messages in this channel') pwarning('message in channel id ' .. channelId .. ' which is unknown, this is a server bug, relogin if you want to see messages in this channel')
end end
@ -685,7 +685,7 @@ function onGameStart()
if savedChannels then if savedChannels then
for channelName, channelId in pairs(savedChannels) do for channelName, channelId in pairs(savedChannels) do
channelId = tonumber(channelId) channelId = tonumber(channelId)
if channelId ~= 0 and channelId < 100 then if channelId ~= -1 and channelId < 100 then
if not table.find(channels, channelId) then if not table.find(channels, channelId) then
g_game.joinChannel(channelId) g_game.joinChannel(channelId)
end end

@ -339,6 +339,7 @@ void Creature::onAppear()
callLuaField("onAppear"); callLuaField("onAppear");
// walk // walk
} else if(m_oldPosition != m_position && m_oldPosition.isInRange(m_position,1,1) && m_allowAppearWalk) { } else if(m_oldPosition != m_position && m_oldPosition.isInRange(m_position,1,1) && m_allowAppearWalk) {
m_allowAppearWalk = false;
walk(m_oldPosition, m_position); walk(m_oldPosition, m_position);
callLuaField("onWalk", m_oldPosition, m_position); callLuaField("onWalk", m_oldPosition, m_position);
// teleport // teleport

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010-2012 OTClient <https://github.com/edubart/client> * Copyright (c) 2010-2012 OTClient <https://github.com/edubart/otclient>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010-2012 OTClient <https://github.com/edubart/client> * Copyright (c) 2010-2012 OTClient <https://github.com/edubart/otclient>
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

@ -441,7 +441,7 @@ ThingPtr Tile::getTopMultiUseThing()
for(uint i = 0; i < m_things.size(); ++i) { for(uint i = 0; i < m_things.size(); ++i) {
ThingPtr thing = m_things[i]; ThingPtr thing = m_things[i];
if(thing->isForceUse() || (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop())) { if(thing->isForceUse() || (!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop() && !thing->isCreature())) {
if(i > 0 && thing->isSplash()) if(i > 0 && thing->isSplash())
return m_things[i-1]; return m_things[i-1];
return thing; return thing;
@ -450,7 +450,7 @@ ThingPtr Tile::getTopMultiUseThing()
for(uint i = 0; i < m_things.size(); ++i) { for(uint i = 0; i < m_things.size(); ++i) {
ThingPtr thing = m_things[i]; ThingPtr thing = m_things[i];
if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnTop()) if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnTop() && !thing->isCreature())
return thing; return thing;
} }

Loading…
Cancel
Save