From: Holger Schemel Date: Sun, 12 Feb 2006 12:39:06 +0000 (+0100) Subject: rnd-20060212-1-src X-Git-Tag: 3.2.0^2~70 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a606b4bf796ba79cea7633dabb28484b6233b5c1;p=rocksndiamonds.git rnd-20060212-1-src * fixed potential crash bug in WarnBuggyBase() (missing boundary check) * fixed bug with CE change order in TestIfElementTouchesCustomElement() * fixed bug when displaying info element without action, but direction --- diff --git a/ChangeLog b/ChangeLog index c8b1327d..d9114718 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-02-12 + * fixed potential crash bug in WarnBuggyBase() (missing boundary check) + +2006-02-11 + * fixed bug with CE change order in TestIfElementTouchesCustomElement() + * fixed bug when displaying info element without action, but direction + 2006-02-09 * fixed minor graphical problems with springs smashing and slurping (when using R'n'D style graphics instead of EMC style graphics) diff --git a/src/conftime.h b/src/conftime.h index f131772c..99eb7d90 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-02-11 15:23]" +#define COMPILE_DATE_STRING "[2006-02-12 13:35]" diff --git a/src/events.c b/src/events.c index 95b9e9f0..c45581e5 100644 --- a/src/events.c +++ b/src/events.c @@ -720,7 +720,9 @@ void HandleKey(Key key, int key_status) case GAME_MODE_INFO: switch(key) { -#if 0 +#if 1 + case KSYM_space: +#else /* !!! only use "space" key to start game from main menu !!! */ case KSYM_space: #endif @@ -762,6 +764,12 @@ void HandleKey(Key key, int key_status) HandleInfoScreen(0,0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK); break; +#ifdef DEBUG + case KSYM_0: + GameFrameDelay = (GameFrameDelay == 500 ? GAME_FRAME_DELAY : 500); + break; +#endif + default: break; } diff --git a/src/files.c b/src/files.c index af9ac437..3d4bd2ef 100644 --- a/src/files.c +++ b/src/files.c @@ -6040,7 +6040,8 @@ void LoadHelpAnimInfo() #if 0 for (i = 0; i < num_list_entries; i++) - printf("::: %d, %d, %d => %d\n", + printf("::: '%s': %d, %d, %d => %d\n", + EL_NAME(helpanim_info[i].element), helpanim_info[i].element, helpanim_info[i].action, helpanim_info[i].direction, diff --git a/src/game.c b/src/game.c index 9c0dcf99..79ba0e8a 100644 --- a/src/game.c +++ b/src/game.c @@ -39,6 +39,7 @@ #define USE_FIXED_DONT_RUN_INTO (USE_NEW_STUFF * 1) #define USE_NEW_SPRING_BUMPER (USE_NEW_STUFF * 1) #define USE_STOP_CHANGED_ELEMENTS (USE_NEW_STUFF * 1) +#define USE_ELEMENT_TOUCHING_BUGFIX (USE_NEW_STUFF * 1) #define USE_QUICKSAND_IMPACT_BUGFIX (USE_NEW_STUFF * 0) @@ -7435,9 +7436,10 @@ static void WarnBuggyBase(int x, int y) for (i = 0; i < NUM_DIRECTIONS; i++) { - int xx = x + xy[i][0], yy = y + xy[i][1]; + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; - if (IS_PLAYER(xx, yy)) + if (IN_LEV_FIELD(xx, yy) && IS_PLAYER(xx, yy)) { PlayLevelSound(x, y, SND_SP_BUGGY_BASE_ACTIVE); @@ -10176,7 +10178,7 @@ void TestIfPlayerTouchesCustomElement(int x, int y) } } -#if 1 +#if USE_ELEMENT_TOUCHING_BUGFIX void TestIfElementTouchesCustomElement(int x, int y) { diff --git a/src/main.h b/src/main.h index 3fcf5c17..7dfec0fd 100644 --- a/src/main.h +++ b/src/main.h @@ -750,7 +750,7 @@ #define EL_CASCADE_TOGGLE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : \ IS_EDITOR_CASCADE_ACTIVE(e) ? (e) - 1 : (e)) -#define EL_NAME(e) (element_info[e].token_name) +#define EL_NAME(e) ((e) >= 0 ? element_info[e].token_name : "(?)") /* fundamental game speed values */ #define ONE_SECOND_DELAY 1000 /* delay value for one second */ @@ -1664,7 +1664,7 @@ #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2005 by Holger Schemel" +#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2006 by Holger Schemel" #define ICON_TITLE_STRING PROGRAM_TITLE_STRING #define COOKIE_PREFIX "ROCKSNDIAMONDS" diff --git a/src/screens.c b/src/screens.c index 90b987f3..9ee9ca49 100644 --- a/src/screens.c +++ b/src/screens.c @@ -826,12 +826,15 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) action = helpanim_info[j].action; direction = helpanim_info[j].direction; + if (element < 0) + element = EL_UNKNOWN; + if (action != -1 && direction != -1) graphic = el_act_dir2img(element, action, direction); else if (action != -1) graphic = el_act2img(element, action); else if (direction != -1) - graphic = el_act2img(element, direction); + graphic = el_dir2img(element, direction); else graphic = el2img(element); @@ -1000,7 +1003,7 @@ void HandleInfoScreen_Elements(int button) } else { - if (DelayReached(&info_delay, GAME_FRAME_DELAY)) + if (DelayReached(&info_delay, GameFrameDelay)) if (page < num_pages) DrawInfoScreen_HelpAnim(page * anims_per_page, num_anims, FALSE);