From e6b3efaee4f084e66f2fa709402f25fc67536952 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 4 Feb 2018 23:33:22 +0100 Subject: [PATCH] fixed broken tapes caused by a bugfix (with TAS snap keys) in EM engine - to prevent breaking old tapes, a version-specific engine value was added - the corresponding snap key bug was initially fixed with commit c138430 - tapes created before 4.0.1.0 and broken due to this fix should work again --- src/game.c | 3 +++ src/game_em/convert.c | 1 + src/game_em/export.h | 1 + src/game_em/input.c | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/src/game.c b/src/game.c index a3ad6f14..b8d863fe 100644 --- a/src/game.c +++ b/src/game.c @@ -2702,6 +2702,9 @@ static void InitGameEngine() game_em.use_single_button = (game.engine_version > VERSION_IDENT(4,0,0,2)); + game_em.use_snap_key_bug = + (game.engine_version < VERSION_IDENT(4,0,1,0)); + /* ---------------------------------------------------------------------- */ /* set maximal allowed number of custom element changes per game frame */ diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 3cad1078..cbc71879 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -1111,6 +1111,7 @@ void prepare_em_level(void) // in function InitGameEngine() (src/game.c): // // - game_em.use_single_button (default: TRUE) + // - game_em.use_snap_key_bug (default: FALSE) game_em.any_player_moving = FALSE; game_em.any_player_snapping = FALSE; diff --git a/src/game_em/export.h b/src/game_em/export.h index 365cafe8..69c92d8e 100644 --- a/src/game_em/export.h +++ b/src/game_em/export.h @@ -668,6 +668,7 @@ struct GameInfo_EM boolean any_player_snapping; boolean use_single_button; + boolean use_snap_key_bug; int last_moving_player; int last_player_direction[MAX_PLAYERS]; diff --git a/src/game_em/input.c b/src/game_em/input.c index b8e2e663..4a2be29e 100644 --- a/src/game_em/input.c +++ b/src/game_em/input.c @@ -161,6 +161,10 @@ void readjoy(byte action, struct PLAYER *ply) !ply->joy_s && !ply->joy_w) ply->joy_snap = snap; + + /* use bug with snap key (mainly TAS keys) sometimes moving the player */ + if (game_em.use_snap_key_bug) + ply->joy_snap = snap; } void SaveEngineSnapshotValues_EM() -- 2.34.1