[Super-tux-commit] supertux/src player.cpp,1.140,1.141 resources.cpp,1.38,1.39 sector.cpp,1.4,1.5
Brought to you by:
wkendrick
From: Marek M. <wa...@us...> - 2004-06-08 17:44:38
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9830/src Modified Files: player.cpp resources.cpp sector.cpp Log Message: Fixed crashes at tiles that are not defined in supertux.stgt - throwing a warning instead Removed all undefined tiles from the world1 levels Renamed "Level Done" music Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.140 retrieving revision 1.141 diff -u -d -r1.140 -r1.141 --- player.cpp 8 Jun 2004 07:12:37 -0000 1.140 +++ player.cpp 8 Jun 2004 17:44:28 -0000 1.141 @@ -289,7 +289,7 @@ if (isbrick(base.x, base.y) || isfullbox(base.x, base.y)) { - Sector::current()->trygrabdistro( + Sector::current()->trygrabdistro( Vector(base.x, base.y - 32), BOUNCE); Sector::current()->trybumpbadguy(Vector(base.x, base.y - 64)); @@ -303,7 +303,7 @@ if (isbrick(base.x+ 31, base.y) || isfullbox(base.x+ 31, base.y)) { - Sector::current()->trygrabdistro( + Sector::current()->trygrabdistro( Vector(base.x+ 31, base.y - 32), BOUNCE); Sector::current()->trybumpbadguy(Vector(base.x+ 31, base.y - 64)); @@ -658,7 +658,6 @@ { Sector::current()->trygrabdistro(Vector(base.x, base.y), NO_BOUNCE); Sector::current()->trygrabdistro(Vector(base.x+ 31, base.y), NO_BOUNCE); - Sector::current()->trygrabdistro( Vector(base.x, base.y + base.height), NO_BOUNCE); Sector::current()->trygrabdistro( @@ -666,7 +665,7 @@ if(size == BIG) { - Sector::current()->trygrabdistro( + Sector::current()->trygrabdistro( Vector(base.x, base.y + base.height / 2), NO_BOUNCE); Sector::current()->trygrabdistro( Vector(base.x+ 31, base.y + base.height / 2), NO_BOUNCE); Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sector.cpp 1 Jun 2004 21:09:37 -0000 1.4 +++ sector.cpp 8 Jun 2004 17:44:29 -0000 1.5 @@ -747,9 +747,14 @@ Tile* tile = solids->get_tile_at(pos); if (!tile) { - char errmsg[64]; + /*char errmsg[64]; sprintf(errmsg, "Invalid tile at %i,%i", (int)((pos.x+1)/32*32), (int)((pos.y+1)/32*32)); - throw SuperTuxException(errmsg, __FILE__, __LINE__); + throw SuperTuxException(errmsg, __FILE__, __LINE__); */ + + //Bad tiles (i.e. tiles that are not defined in supertux.stgt but appear in the map) are changed to ID 0 (blank tile) + std::cout << "Warning: Undefined tile at " <<(int)pos.x/32 << "/" << (int)pos.y/32 << " (ID: " << (int)solids->get_tile_id_at(pos) << ")" << std::endl; + solids->change_at(pos,0); + tile = solids->get_tile_at(pos); } @@ -767,6 +772,7 @@ player_status.score = player_status.score + SCORE_DISTRO; player_status.distros++; + } /* Try to bump a bad guy from below: */ Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- resources.cpp 7 Jun 2004 19:52:46 -0000 1.38 +++ resources.cpp 8 Jun 2004 17:44:29 -0000 1.39 @@ -227,7 +227,7 @@ /* Herring song */ herring_song = sound_manager->load_music(datadir + "/music/SALCON.MOD"); - level_end_song = sound_manager->load_music(datadir + "/music/tux-leveldone.mod"); + level_end_song = sound_manager->load_music(datadir + "/music/leveldone.mod"); } |