otclient icon indicating copy to clipboard operation
otclient copied to clipboard

Classic control issue

Open yrpen opened this issue 13 years ago • 6 comments

I can't use any item inside any container/inventory using right click. Tested on 8.61 server and one random 9.7 server by backpack and food.

http://img51.imageshack.us/img51/6087/rjha.jpg

Tested on latest source, downloaded and compiled yesterday.

yrpen avatar Jul 09 '13 15:07 yrpen

A lot of issues with 8.61, 8.60 works fine.

ERROR: ProtocolGame parse message exception (13 bytes unread, last opcode is 170, prev opcode is 131): unknown message mode 20
ERROR: ProtocolGame parse message exception (29 bytes unread, last opcode is 180, prev opcode is -1): unknown message mode 255

ERROR: no thing at pos:32368 32230 7, stackpos:2
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no creature found to move
at:
    [C++]: ProtocolGame::parseCreatureMove
ERROR: no thing at pos:32367 32230 7, stackpos:3
at:
    [C++]: ProtocolGame::getMappedThing
ERROR: no thing
at:
    [C++]: ProtocolGame::parseTileRemoveThing

BenDol avatar Jul 10 '13 05:07 BenDol

Bugfix: \modules\game_interface\gameinterface.lua

Replace the else block for the classic control with:


--classic control
  else  
    if useThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then
      local player = g_game.getLocalPlayer()     
      if creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then
        g_game.attack(creatureThing)
        return true
      elseif useThing:isContainer() then
        if useThing:getParentContainer() then
          g_game.open(useThing, useThing:getParentContainer())
          return true
        else
          g_game.open(useThing)
          return true
        end
      elseif useThing:isMultiUse() then
        startUseWith(useThing)
        return true
      elseif useThing then
        g_game.use(useThing)
      elseif attackCreature and attackCreature ~= player then
        g_game.attack(attackCreature)
        return true
      else
        g_game.use(useThing)
        return true
      end
      return true
    elseif lookThing and keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseLeftButtuseon or mouseButton == MouseRightButton) then
      g_game.look(lookThing)
      return true
    elseif lookThing and ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then
      g_game.look(lookThing)
      return true
    elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
      createThingMenu(menuPosition, lookThing, useThing, creatureThing)
      return true
    elseif attackCreature and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
      g_game.attack(attackCreature)
      return true
    elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
      g_game.attack(creatureThing)
      return true
    end
  end

Works with the latest source.

LordHepipud avatar Jul 19 '13 21:07 LordHepipud

Thanks LordHepipud it should be a pull request :)

BTW Shift + left click don't work too, but now I can see how it's done, so maybe I will fix it by my self and put code here

yrpen avatar Jul 20 '13 03:07 yrpen

@yrpen are you getting the same protocol errors as I posted above? Open the terminal (Ctrl + T) and see if you are getting the same errors in the 8.61 server. Cheers!

BenDol avatar Jul 20 '13 04:07 BenDol

--- LordHepipud ---

OK "look" problem is fixed now

--- EDIT "look" problem itn't not fixed.

--- EDIT 2 --- Ok now "look" it's fixed in 100%

change this line: elseif lookThing and keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseLeftButtuseon or mouseButton == MouseRightButton) then

for this: elseif lookThing and keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then

--- BeniS ---

I don't get any errors exept "op code", but it's normal I guess.

yrpen avatar Jul 20 '13 04:07 yrpen

Everything I tested with Classic Controll works fine, so I will close it. Reopen if there is still a bug remaining.

TheSumm avatar Oct 09 '13 17:10 TheSumm