X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_em%2Fconvert.c;fp=src%2Fgame_em%2Fconvert.c;h=d8a202d6166883b03cc5fbcdbd8987c407a248c8;hp=5091480478d027682383987f493939c824cfccb3;hb=df3efe7374d7a16149a68557512f3e41ebf7b26f;hpb=7f125847296380e85814a98acb6a0b0dab4c2cf6 diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 50914804..d8a202d6 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -376,9 +376,9 @@ void prepare_em_level(void) for (i = 0; i < GAME_TILE_MAX; i++) lev.android_array[i] = map[cav.android_array[i]]; - /* determine number of players in this level */ lev.home_initial = 0; + /* check for players in this level */ for (i = 0; i < MAX_PLAYERS; i++) { ply[i].exists = FALSE; @@ -401,6 +401,7 @@ void prepare_em_level(void) lev.home = lev.home_initial; players_left = lev.home_initial; + /* assign active players */ for (i = 0; i < MAX_PLAYERS; i++) { if (ply[i].exists) @@ -410,15 +411,20 @@ void prepare_em_level(void) ply[i].alive = TRUE; players_left--; } - else - { - int x = cav.player_x[i]; - int y = cav.player_y[i]; + } + } - lev.cave[lev.left + x][lev.top + y] = Xblank; - lev.next[lev.left + x][lev.top + y] = Xblank; - lev.draw[lev.left + x][lev.top + y] = Xblank; - } + /* remove inactive players */ + for (i = 0; i < MAX_PLAYERS; i++) + { + if (ply[i].exists && !ply[i].alive) + { + int x = cav.player_x[i]; + int y = cav.player_y[i]; + + lev.cave[lev.left + x][lev.top + y] = Xblank; + lev.next[lev.left + x][lev.top + y] = Xblank; + lev.draw[lev.left + x][lev.top + y] = Xblank; } }