Hey guys, I have a problem: when I use a manafluid on my character, the message "Sorry, not possible" appears. Runes works just perfect.
I've tried making modifications to the source code in the game.cpp and gameinterface.lua files, but without success. I've enabled GameForceAllowItemHotkeys feature, but it also didnt work.
Does anyone know what the root of the problem is?
Here are the sections of the code that are possibly involved in the problem:
game.cpp
gameinterface.lua
Thanks in advance !!
I've tried making modifications to the source code in the game.cpp and gameinterface.lua files, but without success. I've enabled GameForceAllowItemHotkeys feature, but it also didnt work.
Does anyone know what the root of the problem is?
Here are the sections of the code that are possibly involved in the problem:
game.cpp
C++:
void Game::useWith(const ItemPtr& item, const ThingPtr& toThing, int subType)
{
if(!canPerformGameAction() || !item || !toThing)
return;
Position pos = item->getPosition();
if(!pos.isValid()) // virtual item
pos = Position(0xFFFF, 0, 0); // means that is an item in inventory
if(toThing->isCreature() && (g_game.getProtocolVersion() >= 780 || g_game.getFeature(Otc::GameForceAllowItemHotkeys)))
m_protocolGame->sendUseOnCreature(pos, item->getId(), subType ? subType : item->getStackPos(), toThing->getId());
else
m_protocolGame->sendUseItemWith(pos, item->getId(), subType ? subType : item->getStackPos(), toThing->getPosition(), toThing->getId(), toThing->getStackPos());
g_lua.callGlobalField("g_game", "onUseWith", pos, item->getId(), toThing, subType);
}
gameinterface.lua
Lua:
function onUseWith(clickedWidget, mousePosition)
if clickedWidget:getClassName() == 'UIGameMap' then
local tile = clickedWidget:getTile(mousePosition)
if tile then
if selectedThing:isFluidContainer() or selectedThing:isMultiUse() then
if selectedThing:getId() == 3180 or selectedThing:getId() == 3156 then
-- special version for mwall
g_game.useWith(selectedThing, tile:getTopUseThing(), selectedSubtype)
else
g_game.useWith(selectedThing, tile:getTopMultiUseThingEx(clickedWidget:getPositionOffset(mousePosition)), selectedSubtype)
end
else
g_game.useWith(selectedThing, tile:getTopUseThing(), selectedSubtype)
end
end
elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
g_game.useWith(selectedThing, clickedWidget:getItem(), selectedSubtype)
elseif clickedWidget:getClassName() == 'UICreatureButton' then
local creature = clickedWidget:getCreature()
if creature then
g_game.useWith(selectedThing, creature, selectedSubtype)
end
end
end
Thanks in advance !!
Last edited: