From 40acf0838d9d6994378d727d3ce66f84b82eb417 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 22 Apr 2004 09:21:51 +0200 Subject: [PATCH] rnd-20040422-1-src * added "enter"/"leave" event for elements affected by relocation * fixed "direct"/"indirect" change order also for "when change" event --- ChangeLog | 2 ++ Makefile | 3 +++ src/conftime.h | 2 +- src/game.c | 15 ++++++++++++--- src/tools.c | 4 +++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44fad831..1f52e0d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2004-04-20 * added "replace when walkable" to relocate player to walkable element + * added "enter"/"leave" event for elements affected by relocation + * fixed "direct"/"indirect" change order also for "when change" event 2004-04-18 * fixed graphic bug when player is snapping while moving in old levels diff --git a/Makefile b/Makefile index 481244f7..9f1e2321 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,9 @@ enginetestcustom: all enginetestfast: all ./Scripts/make_enginetest.sh fast +enginetestnew: all + ./Scripts/make_enginetest.sh new + backup: ./Scripts/make_backup.sh src diff --git a/src/conftime.h b/src/conftime.h index 3a3a5bd3..c9566923 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-04-21 01:52]" +#define COMPILE_DATE_STRING "[2004-04-22 00:31]" diff --git a/src/game.c b/src/game.c index db3d3cbc..0077517d 100644 --- a/src/game.c +++ b/src/game.c @@ -2893,8 +2893,11 @@ void RelocatePlayer(int jx, int jy, int el_player_raw) Feld[jx][jy] = el_player; InitPlayerField(jx, jy, el_player, TRUE); - Feld[jx][jy] = element; /* player may be set on walkable element */ - InitField(jx, jy, FALSE); + if (!ELEM_IS_PLAYER(element)) /* player may be set on walkable element */ + { + Feld[jx][jy] = element; + InitField(jx, jy, FALSE); + } #if 1 if (player == local_player) /* only visually relocate local player */ @@ -7376,6 +7379,7 @@ static boolean ChangeElementNow(int x, int y, int element, int page) { struct ElementChangeInfo *change = &element_info[element].change_page[page]; int target_element; + int old_element = Feld[x][y]; /* always use default change event to prevent running into a loop */ if (ChangeEvent[x][y] == CE_BITMASK_DEFAULT) @@ -7399,7 +7403,7 @@ static boolean ChangeElementNow(int x, int y, int element, int page) Changed[x][y] |= ChangeEvent[x][y]; /* ignore same changes in this frame */ -#if 1 +#if 0 /* !!! indirect change before direct change !!! */ CheckTriggeredElementChangeByPage(x,y,Feld[x][y], CE_OTHER_IS_CHANGING,page); #endif @@ -7549,6 +7553,11 @@ static boolean ChangeElementNow(int x, int y, int element, int page) PlayLevelSoundElementAction(x, y, element, ACTION_CHANGING); } +#if 1 + /* !!! indirect change before direct change !!! */ + CheckTriggeredElementChangeByPage(x,y,old_element,CE_OTHER_IS_CHANGING,page); +#endif + return TRUE; } diff --git a/src/tools.c b/src/tools.c index 39af85ee..0159d9bb 100644 --- a/src/tools.c +++ b/src/tools.c @@ -878,7 +878,9 @@ void DrawPlayer(struct PlayerInfo *player) else if (player_is_moving && IS_ACCESSIBLE_UNDER(last_element)) DrawLevelFieldThruMask(last_jx, last_jy); -#if 1 +#if 0 + /* !!! I have forgotton what this should be good for !!! */ + /* !!! causes player being visible when pushing from within tubes !!! */ if (!player->is_pushing) #endif { -- 2.34.1