X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Fcave.c;h=5fb55dc5bc73cf43b4ff7d3ca5c8b940377e4a08;hb=6fabe8481850a07a3d0bccacefe8c8fe60299f11;hp=08c28ec22de4ccd631f2c0d0d85f5fd70b1d3230;hpb=d4b0925a000fb490f5ade0feecdd4781fc8d0bd5;p=rocksndiamonds.git diff --git a/src/game_em/cave.c b/src/game_em/cave.c index 08c28ec2..5fb55dc5 100644 --- a/src/game_em/cave.c +++ b/src/game_em/cave.c @@ -3,9 +3,7 @@ * cave data structures */ -#include "global.h" -#include "tile.h" -#include "level.h" +#include "main_em.h" struct LevelInfo_EM native_em_level; @@ -17,17 +15,17 @@ void setLevelInfoToDefaults_EM(void) native_em_level.file_version = FILE_VERSION_EM_ACTUAL; native_em_level.lev = &lev; - native_em_level.ply1 = &ply1; - native_em_level.ply2 = &ply2; + for (i = 0; i < MAX_PLAYERS; i++) + native_em_level.ply[i] = &ply[i]; lev.width = 64; lev.height = 32; - ply1.x_initial = 0; - ply1.y_initial = 0; - - ply2.x_initial = 0; - ply2.y_initial = 0; + for (i = 0; i < MAX_PLAYERS; i++) + { + ply[i].x_initial = 0; + ply[i].y_initial = 0; + } lev.lenses_cnt_initial = 0; lev.magnify_cnt_initial = 0; @@ -47,10 +45,25 @@ void setLevelInfoToDefaults_EM(void) for (i = 0; i < TILE_MAX; i++) lev.android_array[i] = Xblank; - lev.home_initial = 2; /* initial number of players in this level */ +#if 1 + /* initial number of players in this level */ + lev.home_initial = 0; - ply1.alive_initial = (lev.home_initial >= 1); - ply2.alive_initial = (lev.home_initial >= 2); + for (i = 0; i < MAX_PLAYERS; i++) + { + ply[i].exists = 0; + ply[i].alive_initial = FALSE; + } +#else + /* initial number of players in this level */ + lev.home_initial = (setup.team_mode ? 2 : 1); + + for (i = 0; i < MAX_PLAYERS; i++) + { + ply[i].exists = 0; + ply[i].alive_initial = (lev.home_initial > i ? TRUE : FALSE); + } +#endif } @@ -89,7 +102,9 @@ boolean LoadNativeLevel_EM(char *filename) return FALSE; } - if (!(file_version = cleanup_em_level(raw_leveldata, raw_leveldata_length))) + file_version = cleanup_em_level(raw_leveldata, raw_leveldata_length,filename); + + if (file_version == FILE_VERSION_EM_UNKNOWN) { Error(ERR_WARN, "unknown EM level '%s' -- using empty level", filename);