From 01b1a4aed0bb4d6813387638064911be4e085183 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Tue, 10 Dec 2024 21:17:26 -0600 Subject: [PATCH] Removed spastic decision timer from showing on replays as it was essentially a memory leak when running the way it was --- .../main/web/js/gemp-022/gameAnimations.js | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameAnimations.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameAnimations.js index 71c024e3b..c35f2326c 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameAnimations.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameAnimations.js @@ -132,7 +132,7 @@ var GameAnimations = Class.extend({ var backSideTestingText = element.getAttribute("backSideTestingText"); // Play-out card affects card animation only if it's not the player who initiated it - if (this.game.spectatorMode || this.game.replayMode || this.game.replayMode || (participantId != this.game.bottomPlayerId)) { + if (this.game.spectatorMode || this.game.replayMode || (participantId != this.game.bottomPlayerId)) { $("#main").queue( function (next) { for (var i = 0; i < targetCardIds.length; i++) { @@ -958,17 +958,19 @@ var GameAnimations = Class.extend({ var that = this; $("#main").queue( function (next) { - that.game.countdownIntervalId = window.setInterval(function(){ - that.game.totalTime -= 1; - that.game.decisionTime += 1; - - if(that.game.allPlayerIds == null) - return; - - var index = that.game.getPlayerIndex(that.game.currentPlayerId); - $("#clock-1").text(that.game.parseTime(that.game.decisionTime)); - $("#clock" + index).text(that.game.parseTime(that.game.totalTime)); - }, 1000); + if(!that.game.replayMode) { + that.game.countdownIntervalId = window.setInterval(function(){ + that.game.totalTime -= 1; + that.game.decisionTime += 1; + + if(that.game.allPlayerIds == null) + return; + + var index = that.game.getPlayerIndex(that.game.currentPlayerId); + $("#clock-1").text(that.game.parseTime(that.game.decisionTime)); + $("#clock" + index).text(that.game.parseTime(that.game.totalTime)); + }, 1000); + } var decisionType = decision.getAttribute("decisionType"); if (decisionType == "INTEGER") {