From: Holger Schemel Date: Fri, 23 Feb 2018 00:04:25 +0000 (+0100) Subject: changed listing all invalid SP level file elements only in debug mode X-Git-Tag: 4.0.1.2^0 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=676fda0c5ba97e2c8b16dffddd590d5ec355c009;p=rocksndiamonds.git changed listing all invalid SP level file elements only in debug mode --- diff --git a/src/files.c b/src/files.c index 757e32a3..85d17128 100644 --- a/src/files.c +++ b/src/files.c @@ -3664,6 +3664,7 @@ void CopyNativeLevel_SP_to_RND(struct LevelInfo *level) { struct LevelInfo_SP *level_sp = level->native_sp_level; LevelInfoType *header = &level_sp->header; + boolean num_invalid_elements = 0; int i, j, x, y; level->fieldx = level_sp->width; @@ -3677,13 +3678,21 @@ void CopyNativeLevel_SP_to_RND(struct LevelInfo *level) int element_new = getMappedElement(map_element_SP_to_RND(element_old)); if (element_new == EL_UNKNOWN) - Error(ERR_WARN, "invalid element %d at position %d, %d", + { + num_invalid_elements++; + + Error(ERR_DEBUG, "invalid element %d at position %d, %d", element_old, x, y); + } level->field[x][y] = element_new; } } + if (num_invalid_elements > 0) + Error(ERR_WARN, "found %d invalid elements%s", num_invalid_elements, + (!options.debug ? " (use '--debug' for more details)" : "")); + for (i = 0; i < MAX_PLAYERS; i++) level->initial_player_gravity[i] = (header->InitialGravity == 1 ? TRUE : FALSE);