projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20030503-1-src
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index 38445772bead7746bf5fc0738298e8611e1ab154..5a63c25ea5fc04c0c8c90389daa48c5023acacb2 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-698,7
+698,7
@@
static void InitGameEngine()
changing_element[element].base_element = element;
changing_element[element].next_element = change->successor;
changing_element[element].base_element = element;
changing_element[element].next_element = change->successor;
- changing_element[
i
].change_delay = 0;
+ changing_element[
element
].change_delay = 0;
if (HAS_CHANGE_EVENT(element, CE_DELAY_FIXED))
changing_element[element].change_delay +=
if (HAS_CHANGE_EVENT(element, CE_DELAY_FIXED))
changing_element[element].change_delay +=
@@
-4593,6
+4593,11
@@
static void ChangeElement(int x, int y)
ResetGfxAnimation(x, y);
ResetRandomAnimationValue(x, y);
ResetGfxAnimation(x, y);
ResetRandomAnimationValue(x, y);
+#if 1
+ InitField(x, y, FALSE);
+ if (CAN_MOVE(element))
+ InitMovDir(x, y);
+#endif
DrawLevelField(x, y);
if (changing_element[element].post_change_function)
DrawLevelField(x, y);
if (changing_element[element].post_change_function)
@@
-4796,6
+4801,15
@@
void GameActions()
element = Feld[x][y];
graphic = el2img(element);
element = Feld[x][y];
graphic = el2img(element);
+#if 0
+ if (element == -1)
+ {
+ printf("::: %d,%d: %d [%d]\n", x, y, element, FrameCounter);
+
+ element = graphic = 0;
+ }
+#endif
+
if (graphic_info[graphic].anim_global_sync)
GfxFrame[x][y] = FrameCounter;
if (graphic_info[graphic].anim_global_sync)
GfxFrame[x][y] = FrameCounter;
@@
-4878,11
+4892,12
@@
void GameActions()
#endif
else if (element == EL_EXPLOSION)
; /* drawing of correct explosion animation is handled separately */
#endif
else if (element == EL_EXPLOSION)
; /* drawing of correct explosion animation is handled separately */
- else if (IS_ANIMATED(graphic))
+ else if (IS_ANIMATED(graphic)
&& !IS_AUTO_CHANGING(element)
)
DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
#if 1
DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
#if 1
- if (IS_AUTO_CHANGING(element))
+ /* this may take place after moving, therefore element may have changed */
+ if (IS_AUTO_CHANGING(Feld[x][y]))
ChangeElement(x, y);
#endif
ChangeElement(x, y);
#endif