From: Holger Schemel Date: Sun, 21 Mar 2004 00:46:13 +0000 (+0100) Subject: rnd-20040321-2-src X-Git-Tag: 3.1.0^2~40 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=93d61986b504bb6c5553d0a6e3c7dd07230ac95b;p=rocksndiamonds.git rnd-20040321-2-src * fixed bug with custom elements digging and leaving elements --- diff --git a/ChangeLog b/ChangeLog index 28dfe09c..8a71ec2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2004-03-20 * added copy and paste functions for custom change pages * enhanced graphical display and functionality of tape recorder + * fixed bug with custom elements digging and leaving elements 2004-03-19 * added move speed faster than "very fast" for custom elements diff --git a/src/conftime.h b/src/conftime.h index 4c5a4421..61003e20 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-03-21 00:07]" +#define COMPILE_DATE_STRING "[2004-03-21 01:39]" diff --git a/src/game.c b/src/game.c index 917fcbb2..0c4100d2 100644 --- a/src/game.c +++ b/src/game.c @@ -1351,6 +1351,7 @@ static void InitGameEngine() element_info[e].move_stepsize = move_stepsize_list[i].move_stepsize; } +#if 0 /* ---------- initialize move dig/leave ---------------------------------- */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) @@ -1358,6 +1359,7 @@ static void InitGameEngine() element_info[i].can_leave_element = FALSE; element_info[i].can_leave_element_last = FALSE; } +#endif /* ---------- initialize gem count --------------------------------------- */ @@ -5556,8 +5558,15 @@ void StartMoving(int x, int y) PlayLevelSoundAction(x, y, action); } +#if 1 + Store[newx][newy] = EL_EMPTY; + if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)) || + element_info[element].move_leave_type == LEAVE_TYPE_UNLIMITED) + Store[newx][newy] = element_info[element].move_leave_element; +#else if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element))) element_info[element].can_leave_element = TRUE; +#endif if (move_pattern & MV_MAZE_RUNNER_STYLE) { @@ -5864,8 +5873,21 @@ void ContinueMoving(int x, int y) { element = Feld[newx][newy] = EL_ACID; } +#if 1 + else if (IS_CUSTOM_ELEMENT(element) && !IS_PLAYER(x, y) && + ei->move_leave_element != EL_EMPTY && Store[x][y] != EL_EMPTY) + { + /* some elements can leave other elements behind after moving */ + + Feld[x][y] = Store[x][y]; + InitField(x, y, FALSE); + + if (GFX_CRUMBLED(Feld[x][y])) + DrawLevelFieldCrumbledSandNeighbours(x, y); + } +#endif - Store[x][y] = 0; + Store[x][y] = EL_EMPTY; MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0; MovDelay[newx][newy] = 0; @@ -5893,7 +5915,7 @@ void ContinueMoving(int x, int y) ResetGfxAnimation(x, y); /* reset animation values for old field */ -#if 1 +#if 0 /* some elements can leave other elements behind after moving */ if (IS_CUSTOM_ELEMENT(element) && !IS_PLAYER(x, y) && ei->move_leave_element != EL_EMPTY && diff --git a/src/main.h b/src/main.h index a6d70583..c5cabbc4 100644 --- a/src/main.h +++ b/src/main.h @@ -1671,8 +1671,10 @@ struct ElementInfo boolean in_group[NUM_GROUP_ELEMENTS]; +#if 0 boolean can_leave_element; /* element can leave other element behind */ boolean can_leave_element_last; +#endif /* ---------- internal values used in level editor ---------- */