Index: Pingus/src/actions/basher.cc =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.cc,v retrieving revision 1.26 diff -u -r1.26 basher.cc --- Pingus/src/actions/basher.cc 16 Aug 2001 22:00:50 -0000 1.26 +++ Pingus/src/actions/basher.cc 29 Mar 2002 23:54:22 -0000 @@ -27,6 +27,9 @@ using namespace std; +// Initialise class static. +const int Basher::bash_height = 4; + Basher::Basher() { } @@ -107,11 +110,17 @@ for(int i = 0; is_finished == false && i < 16; i++) { - if (rel_getpixel(i,0) & ColMap::WALL) - { - if (pingus_debug_flags & PINGUS_DEBUG_ACTIONS) - std::cout << "Basher: Found something to dig..." << std::endl; - return true; + // Check that there is a high enough wall (i.e. not 1 pixel) to bash. + // Probably best to check from where Pingu can't automatically walk up + // up to head collision height. + for (int j = bash_height + 1; j <= 26; j++) + { + if (rel_getpixel(i,j) & ColMap::WALL) + { + if (pingus_debug_flags & PINGUS_DEBUG_ACTIONS) + std::cout << "Basher: Found something to dig..." << std::endl; + return true; + } } } Index: Pingus/src/actions/basher.hh =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.hh,v retrieving revision 1.16 diff -u -r1.16 basher.hh --- Pingus/src/actions/basher.hh 16 Aug 2001 17:46:51 -0000 1.16 +++ Pingus/src/actions/basher.hh 29 Mar 2002 23:54:22 -0000 @@ -43,6 +43,9 @@ bool have_something_to_dig(); void walk_forward(); void bash(); + + /// Defines "wall" height needed so as to determine whether it should be bashed. + const static int bash_height; }; #endif