Advertisement
kolton

Untitled

Jan 7th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function NTSI_findItemGID(GID){
  2.     var _itemunit = getUnit(4,-1,-1,GID);
  3.         if (!_itemunit) { //retry to find item
  4.             var _itemfound = false;
  5.             _itemunit = getUnit(4);
  6.             if(_itemunit){
  7.                     do{
  8.                         if(_itemunit.gid == GID && (_itemunit.mode == 3 || _itemunit.mode == 5)){                  
  9.                             _itemfound = true;
  10.                             _itemunit = copyUnit(_itemunit);
  11.                             break;
  12.                         }
  13.                     } while(_itemunit.getNext());
  14.                     if (!_itemfound){
  15.                         //Dprint("finding failed "+GID);
  16.                         return false;
  17.                     }                      
  18.             }
  19.         }
  20.         return _itemunit;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement