Index: Games/Pingus/src/actions/miner.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/miner.cxx,v retrieving revision 1.16 diff -u -r1.16 miner.cxx --- Games/Pingus/src/actions/miner.cxx 13 Oct 2002 20:25:00 -0000 1.16 +++ Games/Pingus/src/actions/miner.cxx 20 Oct 2002 23:44:52 -0000 @@ -36,6 +36,9 @@ slow_count(0) { sprite.set_align_center_bottom(); + + miner_radius_width = miner_radius.get_width(); + miner_radius_gfx_width = miner_radius_gfx.get_width(); } void @@ -55,11 +58,11 @@ if (!(slow_count % 3)) { WorldObj::get_world()->get_colmap()->remove(miner_radius.get_provider(), - static_cast(pingu->get_x() - 16 + pingu->direction), - static_cast(pingu->get_y() - 31)); + static_cast(pingu->get_x() - (miner_radius_width / 2) + pingu->direction), + static_cast(pingu->get_y() - miner_radius_width + 1) ); WorldObj::get_world()->get_gfx_map()->remove(miner_radius_gfx.get_provider(), - static_cast(pingu->get_x() - 16 + pingu->direction), - static_cast(pingu->get_y() - 31)); + static_cast(pingu->get_x() - (miner_radius_gfx_width / 2) + pingu->direction), + static_cast(pingu->get_y() - miner_radius_gfx_width + 1) ); } pingu->set_pos(pingu->get_x() + pingu->direction, pingu->get_y() + 1); @@ -68,22 +71,22 @@ if (rel_getpixel(0, -1) == Groundtype::GP_NOTHING) { WorldObj::get_world()->get_colmap()->remove(miner_radius, - static_cast(pingu->get_x() - 16 + pingu->direction), - static_cast(pingu->get_y () - 29)); + static_cast(pingu->get_x() - (miner_radius_width / 2) + pingu->direction), + static_cast(pingu->get_y() - miner_radius_width + 3) ); WorldObj::get_world()->get_gfx_map()->remove(miner_radius_gfx, - static_cast(pingu->get_x() - 16 + pingu->direction), - static_cast(pingu->get_y() - 29)); + static_cast(pingu->get_x() - (miner_radius_width / 2) + pingu->direction), + static_cast(pingu->get_y() - miner_radius_width + 3) ); pingu->set_action(Actions::Walker); } else if (rel_getpixel(0, -1) == Groundtype::GP_SOLID) { PingusSound::play_sound("sounds/chink.wav"); WorldObj::get_world()->get_colmap ()->remove(miner_radius, - static_cast(pingu->get_x() - 16 + pingu->direction), - static_cast(pingu->get_y() - 31)); + static_cast(pingu->get_x() - (miner_radius_width / 2) + pingu->direction), + static_cast(pingu->get_y() - miner_radius_width + 1) ); WorldObj::get_world()->get_gfx_map()->remove(miner_radius_gfx, - static_cast(pingu->get_x() - 16 + pingu->direction), - static_cast(pingu->get_y() - 31)); + static_cast(pingu->get_x() - (miner_radius_gfx_width / 2) + pingu->direction), + static_cast(pingu->get_y() - miner_radius_gfx_width + 1) ); pingu->set_action(Actions::Walker); } } Index: Games/Pingus/src/actions/miner.hxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/miner.hxx,v retrieving revision 1.11 diff -u -r1.11 miner.hxx --- Games/Pingus/src/actions/miner.hxx 13 Oct 2002 16:40:01 -0000 1.11 +++ Games/Pingus/src/actions/miner.hxx 20 Oct 2002 23:44:53 -0000 @@ -32,6 +32,13 @@ CL_Surface miner_radius_gfx; Sprite sprite; int slow_count; + + /** Width of the miner_radius surface */ + unsigned int miner_radius_width; + + /** Width of the miner_radius_gfx surface */ + unsigned int miner_radius_gfx_width; + public: Miner (Pingu* p); virtual ~Miner () {}