falyptus

Faith - Stop on Trigger

May 19th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. /* Dans la classe Pathfinding, fonction ValidSinglePath(), après: if(fight != null && fight.isOccuped(dirCaseID))return "stop:"+lastPos; on ajoute: */
  2.  
  3. if(fight == null && map.getCase(lastPos).isTrigger())return "stop:"+lastPos;
  4.  
  5. // Dans la classe Case on ajoute:
  6.  
  7. public boolean isTrigger()
  8. {
  9.     if(_onCellStop != null)
  10.     {
  11.         for(Action act : _onCellStop)
  12.         {
  13.             if(act.getID() == 0) //S'il y a une action de téléportation
  14.             {
  15.                 return true;
  16.             }
  17.         }
  18.     }
  19.         return false;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment