searches the inventory for the specified type/id, sets the pos to it
| 838 | |
| 839 | // searches the inventory for the specified type/id, sets the pos to it |
| 840 | bool Inventory::FindPos(int type, int id) { |
| 841 | int oldt, oldi; |
| 842 | int ttype, tid; |
| 843 | |
| 844 | // save current pos |
| 845 | GetPosTypeID(oldt, oldi); |
| 846 | |
| 847 | // try to move to the specified pos |
| 848 | GotoPos(type, id); |
| 849 | |
| 850 | // see if we got there |
| 851 | GetPosTypeID(ttype, tid); |
| 852 | if ((ttype == type) && (tid == id)) |
| 853 | return true; |
| 854 | else { |
| 855 | // nope, so restore the old pos |
| 856 | GotoPos(oldt, oldi); |
| 857 | return false; |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | // uses an item in the inventory (currently selected one) (returns false if the item doesn't exist) |
| 862 | bool Inventory::UsePos(object *parent) { |
no outgoing calls
no test coverage detected