allow useWith with inventory items

This commit is contained in:
Eduardo Bart 2012-02-07 01:02:06 -02:00
parent 71c706157a
commit 85a121822e
1 changed files with 3 additions and 0 deletions

View File

@ -339,6 +339,9 @@ void Game::useWith(const ThingPtr& fromThing, const ThingPtr& toThing)
return; return;
Position pos = fromThing->getPosition(); Position pos = fromThing->getPosition();
if(!pos.isValid()) // virtual item
pos = Position(0xFFFF, 0, 0); // means that is a item in inventory
int fromStackpos = getThingStackpos(fromThing); int fromStackpos = getThingStackpos(fromThing);
if(fromStackpos == -1) if(fromStackpos == -1)
return; return;