diff --git a/packages/game-app/src/gameView/components/CardsGameListeners/CardsGameListeners.tsx b/packages/game-app/src/gameView/components/CardsGameListeners/CardsGameListeners.tsx index 7e4b5779..930cd90d 100644 --- a/packages/game-app/src/gameView/components/CardsGameListeners/CardsGameListeners.tsx +++ b/packages/game-app/src/gameView/components/CardsGameListeners/CardsGameListeners.tsx @@ -131,8 +131,10 @@ const CardsGameListeners: React.FC = ({ onEvent, children, currentGameSta target: 'panel', type: GameEventType.CardMovingEnd, }); - translationDeltaRef.current[cardId].x = 0; - translationDeltaRef.current[cardId].y = 0; + if (translationDeltaRef.current[cardId]) { + translationDeltaRef.current[cardId].x = 0; + translationDeltaRef.current[cardId].y = 0; + } return; } const parent = gameStateRef.current[cardId].placedIn; @@ -167,8 +169,10 @@ const CardsGameListeners: React.FC = ({ onEvent, children, currentGameSta y: (absoluteWindowPosition.y - panAmountRef.current.y + centerAdjustmentY) / boardScaleRef.current, }; } - translationDeltaRef.current[cardId].x = 0; - translationDeltaRef.current[cardId].y = 0; + if (translationDeltaRef.current[cardId]) { + translationDeltaRef.current[cardId].x = 0; + translationDeltaRef.current[cardId].y = 0; + } const movementEnd = performance.now();