Index: Games/Pingus/src/actions/bridger.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bridger.cxx,v retrieving revision 1.24 diff -u -r1.24 bridger.cxx --- Games/Pingus/src/actions/bridger.cxx 13 Oct 2002 20:25:00 -0000 1.24 +++ Games/Pingus/src/actions/bridger.cxx 21 Oct 2002 22:38:10 -0000 @@ -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) {