X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=e3d3fb1936ba1a93257bd68df031853c40f50047;hb=4fd248da29cc447e267876a0461b9c1a867d30e9;hp=e2128ef1171dd1f892a3d07af96cd84bfbe1694c;hpb=553bbcb054a57644d78eb10f6072ba38a04620af;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index e2128ef1..e3d3fb19 100644 --- a/src/game.c +++ b/src/game.c @@ -42,6 +42,7 @@ #define USE_ELEMENT_TOUCHING_BUGFIX (USE_NEW_STUFF * 1) #define USE_NEW_CONTINUOUS_SNAPPING (USE_NEW_STUFF * 1) #define USE_GFX_RESET_GFX_ANIMATION (USE_NEW_STUFF * 1) +#define USE_BOTH_SWITCHGATE_SWITCHES (USE_NEW_STUFF * 1) #define USE_QUICKSAND_IMPACT_BUGFIX (USE_NEW_STUFF * 0) @@ -1119,10 +1120,12 @@ static void InitField(int x, int y, boolean init_game) } break; +#if !USE_BOTH_SWITCHGATE_SWITCHES case EL_SWITCHGATE_SWITCH_DOWN: /* always start with same switch pos */ if (init_game) Feld[x][y] = EL_SWITCHGATE_SWITCH_UP; break; +#endif case EL_LIGHT_SWITCH_ACTIVE: if (init_game) @@ -4419,12 +4422,25 @@ static void ToggleSwitchgateSwitch(int x, int y) { int element = Feld[xx][yy]; +#if !USE_BOTH_SWITCHGATE_SWITCHES if (element == EL_SWITCHGATE_SWITCH_UP || element == EL_SWITCHGATE_SWITCH_DOWN) { Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP + game.switchgate_pos; DrawLevelField(xx, yy); } +#else + if (element == EL_SWITCHGATE_SWITCH_UP) + { + Feld[xx][yy] = EL_SWITCHGATE_SWITCH_DOWN; + DrawLevelField(xx, yy); + } + else if (element == EL_SWITCHGATE_SWITCH_DOWN) + { + Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP; + DrawLevelField(xx, yy); + } +#endif else if (element == EL_SWITCHGATE_OPEN || element == EL_SWITCHGATE_OPENING) { @@ -8282,15 +8298,15 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) case CA_SET_CE_VALUE: { #if USE_NEW_CUSTOM_VALUE - int last_custom_value = CustomValue[x][y]; + int last_ce_value = CustomValue[x][y]; CustomValue[x][y] = action_arg_number_new; #if 0 - printf("::: Count == %d\n", CustomValue[x][y]); + printf("::: CE value == %d\n", CustomValue[x][y]); #endif - if (CustomValue[x][y] == 0 && last_custom_value > 0) + if (CustomValue[x][y] == 0 && last_ce_value > 0) { #if 0 printf("::: CE_VALUE_GETS_ZERO\n"); @@ -8310,8 +8326,30 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) case CA_SET_CE_SCORE: { +#if USE_NEW_CUSTOM_VALUE + int last_ce_score = ei->collect_score; + ei->collect_score = action_arg_number_new; +#if 0 + printf("::: CE score == %d\n", ei->collect_score); +#endif + + if (ei->collect_score == 0 && last_ce_score > 0) + { +#if 0 + printf("::: CE_SCORE_GETS_ZERO\n"); +#endif + + CheckElementChange(x, y, element, EL_UNDEFINED, CE_SCORE_GETS_ZERO); + CheckTriggeredElementChange(x, y, element, CE_SCORE_GETS_ZERO_OF_X); + +#if 0 + printf("::: RESULT: %d, %d\n", Feld[x][y], ChangePage[x][y]); +#endif + } +#endif + break; }