pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/actions bridger.cxx,1.24,1.25


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions bridger.cxx,1.24,1.25
Date: 21 Oct 2002 23:58:30 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/actions
In directory dark:/tmp/cvs-serv1745

Modified Files:
        bridger.cxx 
Log Message:
commited Gervases bridger patch

Index: bridger.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bridger.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- bridger.cxx 13 Oct 2002 20:25:00 -0000      1.24
+++ bridger.cxx 21 Oct 2002 23:58:27 -0000      1.25
@@ -173,12 +173,34 @@
     }
 }
 
+// way_is_free() needs to stop BRIDGERS from getting stuck between a brick
+// and the ceiling.  The routine also stops cases of Bridgers building up but
+// then not being able to walk all the way down the bridge the it has built.
+// Even though the routine may be the same as brick_placement_allowed(), it is
+// best to keep them apart as they may need to be independent of each other if
+// there needs to be a patch.
 bool
 Bridger::way_is_free()
 {
-  return (rel_getpixel(4,2) ==  Groundtype::GP_NOTHING);
+  bool way_free = true;
+
+  for (int x_inc = 1; x_inc <= 4; x_inc++)
+    {
+      if (rel_getpixel(x_inc, 2) != Groundtype::GP_NOTHING
+         || head_collision_on_walk(x_inc, 2))
+       {
+         way_free = false;
+         break;
+       }
+    }
+
+  return way_free;
 }
 
+// brick_placement_allowed() is mainly for stopping WALKERS from getting stuck
+// between a brick and the ceiling.  Even though the routine may be the same,
+// as way_is_free() it is best to keep them apart as they may need to be
+// independent of each other if there needs to be a patch.
 bool
 Bridger::brick_placement_allowed(void)
 {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]