X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Fconvert.c;h=9b888ffce11733dff5f6825af16a24491971ee77;hb=28fe42eb060d7c9169a9b344678494e7d366a6b0;hp=7b3b036aa1c7b9ad6daf4abf3d975aedb962037b;hpb=88c9b68c44a16e7df62557b63cc7e86731e028c9;p=rocksndiamonds.git diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 7b3b036a..9b888ffc 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -548,7 +548,7 @@ void convert_em_level(unsigned char *src, int file_version) { 0x800, 0x809, 0x812, 0x81B, 0x840, 0x849, 0x852, 0x85B }; - unsigned int i, x, y, temp; + int i, x, y, temp; #if 1 lev.time_seconds = src[0x83E] << 8 | src[0x83F]; @@ -901,8 +901,9 @@ void convert_em_level(unsigned char *src, int file_version) void prepare_em_level(void) { - unsigned int i, x, y; + int i, x, y; int players_left; + int num_tape_players; /* reset all runtime variables to their initial values */ @@ -969,7 +970,11 @@ void prepare_em_level(void) } } - if (!setup.team_mode) + num_tape_players = getActivePlayers_EM(); + + if (num_tape_players != -1) + lev.home_initial = MIN(lev.home_initial, num_tape_players); + else if (!setup.team_mode) lev.home_initial = MIN(lev.home_initial, 1); lev.home = lev.home_initial; @@ -986,7 +991,12 @@ void prepare_em_level(void) } else { - native_em_level.cave[ply[i].x_initial][ply[i].y_initial] = Xblank; + int x = ply[i].x_initial; + int y = ply[i].y_initial; + + native_em_level.cave[x][y] = Xblank; + + Cave[y][x] = Next[y][x] = Draw[y][x] = Xblank; } } } @@ -1011,4 +1021,10 @@ void prepare_em_level(void) i, ply[i].x_initial, ply[i].y_initial, ply[i].alive); #endif } + + game_em.any_player_moving = FALSE; + game_em.last_moving_player = 0; /* default: first player */ + + for (i = 0; i < MAX_PLAYERS; i++) + game_em.last_player_direction[i] = MV_NONE; }