Index: Games/Pingus/src/actions/basher.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.cxx,v retrieving revision 1.16 diff -u -r1.16 basher.cxx --- Games/Pingus/src/actions/basher.cxx 16 Sep 2002 20:31:09 -0000 1.16 +++ Games/Pingus/src/actions/basher.cxx 22 Sep 2002 15:41:07 -0000 @@ -42,6 +42,10 @@ sprite = Sprite (PingusResource::load_surface ("Pingus/basher0", "pingus")); sprite.set_align_center_bottom (); + // The +1 is just in case bash_radius is an odd no. In which case, want to + // round up the result. + int bash_reach = (bash_radius.get_width() + 1) / 2; + // Start a bash even so the action will stops instantly after the // first bash bash (); @@ -114,12 +118,13 @@ return true; } - for(int i = 0; i < 16; ++i) + // Check that there is something within the Basher's reach + for (int i = 0; i <= bash_reach; ++i) { // 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) + for (int j = bash_height + 1; j <= pingu_height; ++j) { if (rel_getpixel(i,j) == Groundtype::GP_GROUND) { Index: Games/Pingus/src/actions/basher.hxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.hxx,v retrieving revision 1.10 diff -u -r1.10 basher.hxx --- Games/Pingus/src/actions/basher.hxx 10 Sep 2002 19:24:19 -0000 1.10 +++ Games/Pingus/src/actions/basher.hxx 22 Sep 2002 15:41:07 -0000 @@ -32,6 +32,9 @@ CL_Surface bash_radius; CL_Surface bash_radius_gfx; int basher_c; + + /// Distance a basher can reach to bash out stuff + int bash_reach; bool first_bash; /// Defines "wall" height needed so as to determine whether it should be bashed.