Fix use-with issue #508

This commit is contained in:
Sam 2014-05-10 17:10:07 +02:00
parent 72b3403728
commit b96be291bb
1 changed files with 5 additions and 1 deletions

View File

@ -354,7 +354,11 @@ function onUseWith(clickedWidget, mousePosition)
if clickedWidget:getClassName() == 'UIMap' then if clickedWidget:getClassName() == 'UIMap' then
local tile = clickedWidget:getTile(mousePosition) local tile = clickedWidget:getTile(mousePosition)
if tile then if tile then
g_game.useWith(selectedThing, tile:getTopMultiUseThing()) if selectedThing:isFluidContainer() then
g_game.useWith(selectedThing, tile:getTopMultiUseThing())
else
g_game.useWith(selectedThing, tile:getTopUseThing())
end
end end
elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
g_game.useWith(selectedThing, clickedWidget:getItem()) g_game.useWith(selectedThing, clickedWidget:getItem())