Commit 01ffedf0 authored by v.tarantik's avatar v.tarantik

#327 pridano osetreni stavu, kdy se pri prohazovani dilku hleda spatne ID

parent 72e9c784
......@@ -60,6 +60,7 @@ import android.view.View;
import android.widget.TextView;
import com.activeandroid.util.Log;
import com.splunk.mint.Mint;
import cz.nic.tablexia.R;
import cz.nic.tablexia.audio.resources.SpeechSounds;
......@@ -824,7 +825,7 @@ public class PronasledovaniActivity extends GameActivity implements IOnSceneTouc
if (fingersCounter == 0) {
twoFingersDown = false;
oneFingerDown = false;
if ((pieceTouched != -1)) {
if (pieceTouched != -1) {
secondFingerReleaseTime = System.currentTimeMillis();
if ((secondFingerReleaseTime - firstFingerReleaseTime) < 300) {
handler.removeCallbacksAndMessages(null);
......@@ -851,8 +852,12 @@ public class PronasledovaniActivity extends GameActivity implements IOnSceneTouc
// dojedeme
int secondPieceID = getCardIDFromActualPosition(pieceHovered);
// Prohozeni pozic dilku
cards.get(draggedPieceID).setActualPositionInGrid(pieceHovered);
cards.get(secondPieceID).setActualPositionInGrid(pieceTouched);
if ((draggedPieceID != -1) && (secondPieceID != -1)) {
cards.get(draggedPieceID).setActualPositionInGrid(pieceHovered);
cards.get(secondPieceID).setActualPositionInGrid(pieceTouched);
} else {
Mint.logEvent("Switching fingers error: " + "Dragged: " + pieceTouched + " Hovered: " + pieceHovered + " draggedPieceID: " + draggedPieceID + " secondPieceId: " + secondPieceID);
}
getGameManager().setExtraInt2AndSave(++movesCounter);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment