From ecd2b11768920d0383309d5d4e25f1e8750fe7f3 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Thu, 9 Sep 2004 18:57:05 +0000 Subject: [PATCH] This should fix the position of ice blocks when hold. SVN-Revision: 1889 --- src/badguy.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) 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) { -- 2.11.0