X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=1aef43abbb1143e3ac3952850e5f6aacb438dc3c;hb=62348584aaa84b398942cea019d772048a6b6f13;hp=7968b389573e613f29b98c94da0921db3427d02c;hpb=837dfa6e81b54c0eeb00eeb7cf472f68d5947bab;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 7968b389..1aef43ab 100644 --- a/src/game.c +++ b/src/game.c @@ -427,7 +427,7 @@ static unsigned long trigger_events[MAX_NUM_ELEMENTS]; void GetPlayerConfig() { if (!audio.sound_available) - setup.sound = FALSE; + setup.sound_simple = FALSE; if (!audio.loops_available) setup.sound_loops = FALSE; @@ -438,7 +438,7 @@ void GetPlayerConfig() if (!video.fullscreen_available) setup.fullscreen = FALSE; - setup.sound_simple = setup.sound; + setup.sound = (setup.sound_simple || setup.sound_loops || setup.sound_music); SetAudioMode(setup.sound); InitJoysticks(); @@ -1222,47 +1222,60 @@ void InitGame() { int start_x = 0, start_y = 0; int found_rating = 0; + int found_element = EL_UNDEFINED; - for(y=0; y < lev_fieldy; y++) + for(y=0; y < lev_fieldy; y++) for(x=0; x < lev_fieldx; x++) { - for(x=0; x < lev_fieldx; x++) + int element = Feld[x][y]; + int content; + int xx, yy; + boolean is_player; + + if (!IS_CUSTOM_ELEMENT(element)) + continue; + + if (CAN_CHANGE(element)) { - int element = Feld[x][y]; + content = element_info[element].change.target_element; + is_player = ELEM_IS_PLAYER(content); - if (IS_CUSTOM_ELEMENT(element)) + if (is_player && (found_rating < 3 || element < found_element)) { - int xx, yy; + start_x = x; + start_y = y; - for(yy=0; yy < 3; yy++) - { - for(xx=0; xx < 3; xx++) - { - int content; - boolean is_player; + found_rating = 3; + found_element = element; + } + } - content = element_info[element].content[xx][yy]; - is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY); + for(yy=0; yy < 3; yy++) for(xx=0; xx < 3; xx++) + { + content = element_info[element].content[xx][yy]; + is_player = ELEM_IS_PLAYER(content); + + if (is_player && (found_rating < 2 || element < found_element)) + { + start_x = x + xx - 1; + start_y = y + yy - 1; - if (is_player && found_rating < 2) - { - start_x = x + xx - 1; - start_y = y + yy - 1; + found_rating = 2; + found_element = element; + } - found_rating = 2; - } + if (!CAN_CHANGE(element)) + continue; - content = element_info[element].change.content[xx][yy]; - is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY); + content = element_info[element].change.content[xx][yy]; + is_player = ELEM_IS_PLAYER(content); - if (is_player && found_rating < 1) - { - start_x = x + xx - 1; - start_y = y + yy - 1; + if (is_player && (found_rating < 1 || element < found_element)) + { + start_x = x + xx - 1; + start_y = y + yy - 1; - found_rating = 1; - } - } - } + found_rating = 1; + found_element = element; } } } @@ -6573,6 +6586,7 @@ void ScrollFigure(struct PlayerInfo *player, int mode) if (Feld[jx][jy] == EL_EXIT_OPEN || Feld[jx][jy] == EL_SP_EXIT_OPEN) { + DrawPlayer(player); /* needed here only to cleanup last field */ RemoveHero(player); if (local_player->friends_still_needed == 0 ||