From: Holger Schemel Date: Mon, 19 Jan 2004 19:10:04 +0000 (+0100) Subject: rnd-20040119-B-src X-Git-Tag: 3.1.0^2~90 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=49600fe866a0590700a684593913fc5674332201;p=rocksndiamonds.git rnd-20040119-B-src * fixed bug which allowed creating emeralds by escaping explosions --- diff --git a/ChangeLog b/ChangeLog index 52c346e5..aa185bf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ + +2004-01-19 + * fixed bug which allowed creating emeralds by escaping explosions + 2004-01-18 * custom elements can change (limited) or leave (unlimited) elements * finally added multiple matches using group elements diff --git a/Makefile b/Makefile index e97587db..63962f78 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,8 @@ CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc SRC_DIR = src MAKE_CMD = $(MAKE) -C $(SRC_DIR) -# DEFAULT_TARGET = x11 -DEFAULT_TARGET = sdl +DEFAULT_TARGET = x11 +# DEFAULT_TARGET = sdl # ----------------------------------------------------------------------------- diff --git a/src/Makefile b/src/Makefile index 976f86bc..a0d7cfa2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -76,7 +76,8 @@ endif ifeq ($(TARGET),x11) SYS_CFLAGS = -DTARGET_X11 $(X11_INCL) -SYS_LDFLAGS = $(X11_LIBS) -lX11 +# SYS_LDFLAGS = $(X11_LIBS) -lX11 +SYS_LDFLAGS = $(XLIB_PATH)/libX11.a endif ifeq ($(TARGET),sdl) diff --git a/src/conftime.h b/src/conftime.h index a28ef038..333e8073 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-01-18 18:14]" +#define COMPILE_DATE_STRING "[2004-01-19 19:09]" diff --git a/src/game.c b/src/game.c index 1e059f86..bab2a312 100644 --- a/src/game.c +++ b/src/game.c @@ -2499,17 +2499,17 @@ void Explode(int ex, int ey, int phase, int mode) switch(StorePlayer[ex][ey]) { case EL_PLAYER_2: - Store[x][y] = EL_EMERALD_RED; + Store[x][y] = EL_PLAYER_IS_EXPLODING_2; break; case EL_PLAYER_3: - Store[x][y] = EL_EMERALD; + Store[x][y] = EL_PLAYER_IS_EXPLODING_3; break; case EL_PLAYER_4: - Store[x][y] = EL_EMERALD_PURPLE; + Store[x][y] = EL_PLAYER_IS_EXPLODING_4; break; case EL_PLAYER_1: default: - Store[x][y] = EL_EMERALD_YELLOW; + Store[x][y] = EL_PLAYER_IS_EXPLODING_1; break; } @@ -2656,6 +2656,17 @@ void Explode(int ex, int ey, int phase, int mode) Store[x][y] = Store2[x][y] = 0; GfxElement[x][y] = EL_UNDEFINED; + /* player can escape from explosions and might therefore be still alive */ + if (element >= EL_PLAYER_IS_EXPLODING_1 && + element <= EL_PLAYER_IS_EXPLODING_4) + Feld[x][y] = (stored_player[element - EL_PLAYER_IS_EXPLODING_1].active ? + EL_EMPTY : + element == EL_PLAYER_IS_EXPLODING_1 ? EL_EMERALD_YELLOW : + element == EL_PLAYER_IS_EXPLODING_2 ? EL_EMERALD_RED : + element == EL_PLAYER_IS_EXPLODING_3 ? EL_EMERALD : + EL_EMERALD_PURPLE); + + /* restore probably existing indestructible background element */ if (Back[x][y] && IS_INDESTRUCTIBLE(Back[x][y])) element = Feld[x][y] = Back[x][y]; Back[x][y] = 0; @@ -2666,8 +2677,11 @@ void Explode(int ex, int ey, int phase, int mode) ChangePage[x][y] = -1; InitField(x, y, FALSE); +#if 1 + /* !!! not needed !!! */ if (CAN_MOVE(element)) InitMovDir(x, y); +#endif DrawLevelField(x, y); TestIfElementTouchesCustomElement(x, y); diff --git a/src/main.c b/src/main.c index 990a7b71..6ab095eb 100644 --- a/src/main.c +++ b/src/main.c @@ -3684,6 +3684,26 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] = "-", "-" }, + { + "player_is_exploding_1", + "-", + "-" + }, + { + "player_is_exploding_2", + "-", + "-" + }, + { + "player_is_exploding_3", + "-", + "-" + }, + { + "player_is_exploding_4", + "-", + "-" + }, { "quicksand.filling", "quicksand", diff --git a/src/main.h b/src/main.h index f449795a..345e9f9d 100644 --- a/src/main.h +++ b/src/main.h @@ -910,12 +910,16 @@ #define EL_EXPANDABLE_WALL_GROWING (EL_FIRST_RUNTIME_UNREAL + 8) #define EL_FLAMES (EL_FIRST_RUNTIME_UNREAL + 9) #define EL_PLAYER_IS_LEAVING (EL_FIRST_RUNTIME_UNREAL + 10) -#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 11) -#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 12) -#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 13) +#define EL_PLAYER_IS_EXPLODING_1 (EL_FIRST_RUNTIME_UNREAL + 11) +#define EL_PLAYER_IS_EXPLODING_2 (EL_FIRST_RUNTIME_UNREAL + 12) +#define EL_PLAYER_IS_EXPLODING_3 (EL_FIRST_RUNTIME_UNREAL + 13) +#define EL_PLAYER_IS_EXPLODING_4 (EL_FIRST_RUNTIME_UNREAL + 14) +#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 15) +#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 16) +#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 17) /* dummy elements (never used as game elements, only used as graphics) */ -#define EL_FIRST_DUMMY (EL_FIRST_RUNTIME_UNREAL + 14) +#define EL_FIRST_DUMMY (EL_FIRST_RUNTIME_UNREAL + 18) #define EL_STEELWALL_TOPLEFT (EL_FIRST_DUMMY + 0) #define EL_STEELWALL_TOPRIGHT (EL_FIRST_DUMMY + 1)