X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=13ae62bb51347d394f92fcb9647febd254b49ce9;hb=d82356191574038684ec15bb2e13fe803de52b53;hp=08d980b2a3efae544677aaf7596e2cdb8eab1912;hpb=39ea277283e3a9c633240733d553f1f1eec66f3c;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 08d980b2..13ae62bb 100644 --- a/src/game.c +++ b/src/game.c @@ -59,7 +59,7 @@ void InitGame() player->active = FALSE; player->action = 0; - player->potential_action = 0; + player->effective_action = 0; player->score = 0; player->gems_still_needed = level.edelsteine; @@ -287,6 +287,28 @@ void InitGame() } } + /* when in single player mode, eliminate all but the first active player */ + if (!options.network && !setup.team_mode) + { + for(i=0; ijx, jy = player->jy; + + if (player->active) + { + player->active = FALSE; + StorePlayer[jx][jy] = 0; + Feld[jx][jy] = EL_LEERRAUM; + } + } + } + } + } for(i=0; i= 0) @@ -550,7 +572,7 @@ boolean NewHiScore() LoadScore(level_nr); - if (!strcmp(setup.alias_name,EMPTY_ALIAS) || + if (!strcmp(setup.player_name, EMPTY_ALIAS) || local_player->score < highscore[MAX_SCORE_ENTRIES-1].Score) return(-1); @@ -566,7 +588,7 @@ boolean NewHiScore() #ifdef ONE_PER_NAME for(l=k;lscore; position = k; break; } #ifdef ONE_PER_NAME - else if (!strcmp(setup.alias_name,highscore[k].Name)) + else if (!strncmp(setup.player_name, highscore[k].Name, MAX_NAMELEN - 1)) break; /* Spieler schon mit besserer Punktzahl in der Liste */ #endif @@ -2810,7 +2833,7 @@ void CheckForDragon(int x, int y) } } -void PlayerActions(struct PlayerInfo *player, byte player_action) +static void PlayerActions(struct PlayerInfo *player, byte player_action) { static byte stored_player_action[MAX_PLAYERS]; static int num_stored_actions = 0; @@ -2915,6 +2938,7 @@ void GameActions() int sieb_x = 0, sieb_y = 0; int i, x,y, element; byte *recorded_player_action; + byte summarized_player_action = 0; if (game_status != PLAYING) return; @@ -2968,19 +2992,23 @@ void GameActions() recorded_player_action = (tape.playing ? TapePlayAction() : NULL); - if (network_playing) + for(i=0; ieffective_action = summarized_player_action; + for(i=0; i lev_fieldx - SCR_FIELDX + 2) - scroll_x = (scroll_x < -1 ? -1 : lev_fieldx - SCR_FIELDX + 2); + if (scroll_x < -1 || scroll_x > lev_fieldx - SCR_FIELDX + 1) + scroll_x = (scroll_x < -1 ? -1 : lev_fieldx - SCR_FIELDX + 1); /* don't scroll more than one field at a time */ scroll_x = old_scroll_x + SIGN(scroll_x - old_scroll_x); @@ -3364,8 +3392,8 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) scroll_y = jy-MIDPOSY + (scroll_y < jy-MIDPOSY ? -offset : +offset); /* don't scroll over playfield boundaries */ - if (scroll_y < -1 || scroll_y > lev_fieldy - SCR_FIELDY + 2) - scroll_y = (scroll_y < -1 ? -1 : lev_fieldy - SCR_FIELDY + 2); + if (scroll_y < -1 || scroll_y > lev_fieldy - SCR_FIELDY + 1) + scroll_y = (scroll_y < -1 ? -1 : lev_fieldy - SCR_FIELDY + 1); /* don't scroll more than one field at a time */ scroll_y = old_scroll_y + SIGN(scroll_y - old_scroll_y);