From: Holger Schemel Date: Wed, 22 Feb 2017 18:48:20 +0000 (+0100) Subject: fixed copying level from native R'n'D to MM engine X-Git-Tag: 4.1.0.0~193 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=057a22e9dd34d456b1906ba0b89266ad78feb31a;p=rocksndiamonds.git fixed copying level from native R'n'D to MM engine --- diff --git a/src/files.c b/src/files.c index 795aeda2..0f478eb1 100644 --- a/src/files.c +++ b/src/files.c @@ -3917,7 +3917,8 @@ void CopyNativeLevel_RND_to_MM(struct LevelInfo *level) for (x = 0; x < level->fieldx; x++) for (y = 0; y < level->fieldy; y++) - level_mm->field[x][y] = map_element_RND_to_MM(level->field[x][y]); + Ur[x][y] = + level_mm->field[x][y] = map_element_RND_to_MM(level->field[x][y]); } void CopyNativeLevel_MM_to_RND(struct LevelInfo *level) @@ -3947,6 +3948,17 @@ void CopyNativeLevel_MM_to_RND(struct LevelInfo *level) for (x = 0; x < level->fieldx; x++) for (y = 0; y < level->fieldy; y++) level->field[x][y] = map_element_MM_to_RND(level_mm->field[x][y]); + + if (level_mm->auto_count_kettles) + { + level->gems_needed = 0; + + for (x = 0; x < level->fieldx; x++) + for (y = 0; y < level->fieldy; y++) + if (level->field[x][y] == EL_MM_KETTLE || + level->field[x][y] == EL_DF_CELL) + level->gems_needed++; + } } diff --git a/src/game_mm/export.h b/src/game_mm/export.h index eb6a6aa7..07417cee 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -187,6 +187,8 @@ extern struct GameInfo_MM game_mm; extern struct LevelInfo_MM native_mm_level; extern struct EngineSnapshotInfo_MM engine_snapshot_mm; +extern short Ur[MM_MAX_PLAYFIELD_WIDTH][MM_MAX_PLAYFIELD_HEIGHT]; + extern void mm_open_all(); extern void mm_close_all();