Revision: 6457
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6457&view=rev
Author:   gerkey
Date:     2008-05-28 11:46:20 -0700 (Wed, 28 May 2008)

Log Message:
-----------
added special case for planning from one cell to same cell

Modified Paths:
--------------
    code/player/trunk/server/drivers/planner/wavefront/plan_plan.c

Modified: code/player/trunk/server/drivers/planner/wavefront/plan_plan.c
===================================================================
--- code/player/trunk/server/drivers/planner/wavefront/plan_plan.c      
2008-05-23 18:59:01 UTC (rev 6456)
+++ code/player/trunk/server/drivers/planner/wavefront/plan_plan.c      
2008-05-28 18:46:20 UTC (rev 6457)
@@ -162,7 +162,7 @@
   // Initialize the start cell
   li = PLAN_GXWX(plan, lx);
   lj = PLAN_GYWY(plan, ly);
-  
+
   //printf("planning from %d,%d to %d,%d\n", li,lj,gi,gj);
 
   if(!PLAN_VALID_BOUNDS(plan, gi, gj))
@@ -186,6 +186,11 @@
 
   cell = plan->cells + PLAN_INDEX(plan, gi, gj);
   cell->plan_cost = 0;
+
+  // Are we done?
+  if((li == gi) && (lj == gj))
+    return(0);
+  
   plan_push(plan, cell);
 
   while (1)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to