From: Holger Schemel Date: Thu, 29 Jan 2004 17:55:23 +0000 (+0100) Subject: rnd-20040129-2-src X-Git-Tag: 3.1.0^2~82 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0ae305660baec1a7568ac7df7f296b695904d59a;p=rocksndiamonds.git rnd-20040129-2-src * fixed bug: when gravity active, port above player can now be entered * removed "one white dot" mouse pointer which irritated some people --- diff --git a/ChangeLog b/ChangeLog index 3f77708c..9a1a7788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2004-01-29 * fixed bug: infotron can now smash yellow disks + * fixed bug: when gravity active, port above player can now be entered + * removed "one white dot" mouse pointer which irritated some people 2004-01-26 * added "choice type" for group element selection diff --git a/src/conftime.h b/src/conftime.h index c163785e..488aa6b8 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-01-29 17:39]" +#define COMPILE_DATE_STRING "[2004-01-29 18:51]" diff --git a/src/game.c b/src/game.c index 6e5475eb..7b225c5e 100644 --- a/src/game.c +++ b/src/game.c @@ -7550,10 +7550,8 @@ void ScrollLevel(int dx, int dy) redraw_mask |= REDRAW_FIELD; } -static boolean canEnterSupaplexPort(int x, int y, int move_dir) +static boolean canEnterSupaplexPort(int x, int y, int dx, int dy) { - int dx = (move_dir & MV_LEFT ? -1 : move_dir & MV_RIGHT ? +1 : 0); - int dy = (move_dir & MV_UP ? -1 : move_dir & MV_DOWN ? +1 : 0); int nextx = x + dx, nexty = y + dy; int element = Feld[x][y]; @@ -7603,7 +7601,9 @@ static void CheckGravityMovement(struct PlayerInfo *player) boolean player_is_moving_to_valid_field = (IN_LEV_FIELD(new_jx, new_jy) && (Feld[new_jx][new_jy] == EL_SP_BASE || - Feld[new_jx][new_jy] == EL_SAND)); + Feld[new_jx][new_jy] == EL_SAND || + (IS_SP_PORT(Feld[new_jx][new_jy]) && + canEnterSupaplexPort(new_jx, new_jy, dx, dy)))); /* !!! extend EL_SAND to anything diggable !!! */ if (field_under_player_is_free && @@ -8806,6 +8806,10 @@ int DigField(struct PlayerInfo *player, case EL_SP_GRAVITY_PORT_RIGHT: case EL_SP_GRAVITY_PORT_UP: case EL_SP_GRAVITY_PORT_DOWN: +#if 1 + if (!canEnterSupaplexPort(x, y, dx, dy)) + return MF_NO_ACTION; +#else if ((dx == -1 && element != EL_SP_PORT_LEFT && element != EL_SP_GRAVITY_PORT_LEFT && @@ -8829,6 +8833,7 @@ int DigField(struct PlayerInfo *player, !IN_LEV_FIELD(nextx, nexty) || !IS_FREE(nextx, nexty)) return MF_NO_ACTION; +#endif if (element == EL_SP_GRAVITY_PORT_LEFT || element == EL_SP_GRAVITY_PORT_RIGHT || diff --git a/src/init.c b/src/init.c index ecbe8b61..69158a75 100644 --- a/src/init.c +++ b/src/init.c @@ -3119,6 +3119,11 @@ void InitElementPropertiesEngine(int engine_version) SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, (CAN_EXPLODE(i) && !CAN_EXPLODE_1X1(i) && !CAN_EXPLODE_DYNA(i))); + + /* ---------- SP_PORT -------------------------------------------------- */ + SET_PROPERTY(i, EP_SP_PORT, (IS_SP_ELEMENT(i) && + IS_PASSABLE_INSIDE(i))); + #if 0 if (i == EL_CUSTOM_START + 253) printf("::: %d, %d, %d -> %d\n", diff --git a/src/libgame/system.c b/src/libgame/system.c index 9934650f..656d97f9 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -868,6 +868,31 @@ static const char *cursor_image_playfield[] = ". c #ffffff", " c None", +#if 1 + /* some people complained about a "white dot" on the screen and thought it + was a graphical error... OK, let's just remove the whole pointer :-) */ + + /* pixels */ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + + /* hot spot */ + "0,0" +#else /* pixels */ " X ", "X.X ", @@ -888,6 +913,7 @@ static const char *cursor_image_playfield[] = /* hot spot */ "1,1" +#endif }; #if defined(TARGET_SDL) diff --git a/src/main.h b/src/main.h index 9d78b18a..ae2aa5d0 100644 --- a/src/main.h +++ b/src/main.h @@ -135,13 +135,14 @@ #define EP_CAN_SMASH 69 #define EP_CAN_EXPLODE 70 #define EP_CAN_EXPLODE_3X3 71 +#define EP_SP_PORT 72 /* values for internal purpose only (level editor) */ -#define EP_EXPLODE_RESULT 72 -#define EP_WALK_TO_OBJECT 73 -#define EP_DEADLY 74 +#define EP_EXPLODE_RESULT 73 +#define EP_WALK_TO_OBJECT 74 +#define EP_DEADLY 75 -#define NUM_ELEMENT_PROPERTIES 75 +#define NUM_ELEMENT_PROPERTIES 76 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -345,6 +346,7 @@ #define CAN_SMASH(e) HAS_PROPERTY(e, EP_CAN_SMASH) #define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE) #define CAN_EXPLODE_3X3(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_3X3) +#define IS_SP_PORT(e) HAS_PROPERTY(e, EP_SP_PORT) /* special macros used in game engine */ #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \