From b9aaf4d5a4cfb804fe63c548cce1c93859c714a8 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 11 Jan 2025 20:10:46 +0100 Subject: [PATCH] added storing 2nd last BD player movement direction (not used yet) --- src/game_bd/bd_cave.h | 1 + src/game_bd/bd_caveengine.c | 1 + src/game_bd/bd_caveobject.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/game_bd/bd_cave.h b/src/game_bd/bd_cave.h index f76c215b..6284d556 100644 --- a/src/game_bd/bd_cave.h +++ b/src/game_bd/bd_cave.h @@ -642,6 +642,7 @@ typedef struct _gd_cave boolean inbox_flash_toggle; // negated every scan. helps drawing inboxes, and making // players be born at different times. GdDirection last_direction; // last direction player moved. used by draw routines + GdDirection last_direction_2nd; // 2nd last direction player moved. used by draw routines GdDirection last_horizontal_direction; int biters_wait_frame; // number of frames to wait until biters will move again int replicators_wait_frame; // number of frames to wait until replicators are diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index ba4aa4c8..7e79685e 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -4392,6 +4392,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, #endif // set these for drawing. + cave->last_direction_2nd = cave->last_direction; cave->last_direction = player_move; // here we remember last movements for animation. this is needed here, as animation diff --git a/src/game_bd/bd_caveobject.c b/src/game_bd/bd_caveobject.c index ab9551b0..19f3b91c 100644 --- a/src/game_bd/bd_caveobject.c +++ b/src/game_bd/bd_caveobject.c @@ -1585,6 +1585,7 @@ GdCave *gd_cave_new_rendered(const GdCave *data, const int level, const unsigned gd_cave_correct_visible_size(cave); cave->last_direction = GD_MV_STILL; + cave->last_direction_2nd = GD_MV_STILL; cave->last_horizontal_direction = GD_MV_STILL; // list of cave variables for effects that can create other game elements -- 2.34.1