From: Ricardo Cruz Date: Thu, 9 Sep 2004 18:57:05 +0000 (+0000) Subject: This should fix the position of ice blocks when hold. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ecd2b11768920d0383309d5d4e25f1e8750fe7f3;p=supertux.git This should fix the position of ice blocks when hold. SVN-Revision: 1889 --- diff --git a/src/badguy.cpp b/src/badguy.cpp index e0efb7208..1303cb08b 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -339,16 +339,23 @@ BadGuy::action_mriceblock(double elapsed_time) { /* FIXME: The pbad object shouldn't know about pplayer objects. */ /* If we're holding the iceblock */ dir = tux.dir; - if(dir==RIGHT) + if(tux.size == SMALL) { - base.x = tux.base.x + 16; - base.y = tux.base.y + tux.base.height/1.5 - base.height; + if(dir == RIGHT) + base.x = tux.base.x + 24; + else // dir == LEFT + base.x = tux.base.x - 12; + base.y = tux.base.y + tux.base.height/1.5 - base.height; } - else /* facing left */ + else // TUX == BIG { - base.x = tux.base.x - 16; - base.y = tux.base.y + tux.base.height/1.5 - base.height; + if(dir == RIGHT) + base.x = tux.base.x + 24; + else // dir == LEFT + base.x = tux.base.x - 4; + base.y = tux.base.y + tux.base.height/1.5 - base.height; } + if(collision_object_map(base)) { base.x = tux.base.x; @@ -1325,7 +1332,8 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type) // Put bad guys a part (or they get jammed) // only needed to do to one of them - base.x = pbad_c->base.x + pbad_c->base.width + 1; + if (physic.get_velocity_x() != 0) + base.x = pbad_c->base.x + pbad_c->base.width + 1; } else if (dir == RIGHT) {