Browse Source

Merge pull request #874 from EgzoT/EgzoT-useWith_fix

Fixed problem with function "useWith" on creatures
Eduardo Bart 3 years ago
parent
commit
7046fa1cdb
No account linked to committer's email address
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/client/game.cpp

+ 4
- 1
src/client/game.cpp View File

@@ -856,7 +856,10 @@ void Game::useWith(const ItemPtr& item, const ThingPtr& toThing)
856 856
     if(!pos.isValid()) // virtual item
857 857
         pos = Position(0xFFFF, 0, 0); // means that is an item in inventory
858 858
 
859
-    m_protocolGame->sendUseItemWith(pos, item->getId(), item->getStackPos(), toThing->getPosition(), toThing->getId(), toThing->getStackPos());
859
+    if(toThing->isCreature())
860
+        m_protocolGame->sendUseOnCreature(pos, item->getId(), item->getStackPos(), toThing->getId());
861
+    else
862
+        m_protocolGame->sendUseItemWith(pos, item->getId(), item->getStackPos(), toThing->getPosition(), toThing->getId(), toThing->getStackPos());
860 863
 }
861 864
 
862 865
 void Game::useInventoryItemWith(int itemId, const ThingPtr& toThing)

Loading…
Cancel
Save