From 45338cdd7f037ba7b8c9e25d000ce351d86567a6 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Wed, 12 Dec 2018 03:12:07 +0100
Subject: [PATCH] Basic fixes in Ultima, still unimplemented

---
 public/javascripts/variants/Ultima.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/public/javascripts/variants/Ultima.js b/public/javascripts/variants/Ultima.js
index 9212afba..4612da10 100644
--- a/public/javascripts/variants/Ultima.js
+++ b/public/javascripts/variants/Ultima.js
@@ -52,6 +52,7 @@ class UltimaRules extends ChessRules
 
 	getPotentialMovesFrom([x,y])
 	{
+		// TODO: pre-check: is thing on this square immobilized? If yes, return []
 		switch (this.getPiece(x,y))
 		{
 			case VariantRules.IMMOBILIZER:
@@ -121,6 +122,11 @@ class UltimaRules extends ChessRules
 		return super.getPotentialQueenMoves(sq);
 	}
 
+	getPotentialImmobilizerMoves(sq)
+	{
+		return super.getPotentialQueenMoves(sq);
+	}
+
 	getPotentialKingMoves(sq)
 	{
 		const V = VariantRules;
@@ -223,7 +229,7 @@ class UltimaRules extends ChessRules
 			randIndex = _.random(1);
 			const rookPos = positions[randIndex];
 			positions.splice(randIndex, 1);
-			const immobilizerPos = positions[2];
+			const immobilizerPos = positions[0];
 
 			pieces[c][bishop1Pos] = 'b';
 			pieces[c][bishop2Pos] = 'b';
-- 
2.44.0