From: Holger Schemel Date: Wed, 24 Jun 2015 23:21:26 +0000 (+0200) Subject: fixed movement-based engine snapshots when playing tapes X-Git-Tag: 4.0.0.0-rc1~167 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=00b53c1316174dabc310c5967beee2edb4fa0842 fixed movement-based engine snapshots when playing tapes --- diff --git a/src/game.c b/src/game.c index 0b2d47fd..8273cb71 100644 --- a/src/game.c +++ b/src/game.c @@ -10977,23 +10977,6 @@ void GameActions() byte tape_action[MAX_PLAYERS]; int i; - for (i = 0; i < MAX_PLAYERS; i++) - { - struct PlayerInfo *player = &stored_player[i]; - - // allow engine snapshot if movement attempt was stopped - if ((game.snapshot.last_action[i] & KEY_MOTION) != 0 && - (player->action & KEY_MOTION) == 0) - game.snapshot.changed_action = TRUE; - - // allow engine snapshot in case of snapping/dropping attempt - if ((game.snapshot.last_action[i] & KEY_BUTTON) == 0 && - (player->action & KEY_BUTTON) != 0) - game.snapshot.changed_action = TRUE; - - game.snapshot.last_action[i] = player->action; - } - /* detect endless loops, caused by custom element programming */ if (recursion_loop_detected && recursion_loop_depth == 0) { @@ -11200,6 +11183,21 @@ void GameActions() #endif #endif + for (i = 0; i < MAX_PLAYERS; i++) + { + // allow engine snapshot in case of changed movement attempt + if ((game.snapshot.last_action[i] & KEY_MOTION) != + (stored_player[i].effective_action & KEY_MOTION)) + game.snapshot.changed_action = TRUE; + + // allow engine snapshot in case of snapping/dropping attempt + if ((game.snapshot.last_action[i] & KEY_BUTTON) == 0 && + (stored_player[i].effective_action & KEY_BUTTON) != 0) + game.snapshot.changed_action = TRUE; + + game.snapshot.last_action[i] = stored_player[i].effective_action; + } + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) { GameActions_EM_Main();