Commit 7b0ae6e 1 parent b700d2d commit 7b0ae6e Copy full SHA for 7b0ae6e
File tree 1 file changed +6
-4
lines changed
modules/challenge/src/main
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
package lila .challenge
2
2
3
- import chess .variant .Variant
3
+ import chess .variant .{ Variant , FromPosition }
4
4
import chess .{ Mode , Clock , Speed }
5
5
import org .joda .time .DateTime
6
6
@@ -102,11 +102,13 @@ object Challenge {
102
102
case _ => Speed .Correspondence
103
103
}
104
104
105
- private def perfTypeOf (variant : Variant , timeControl : TimeControl ) =
105
+ private def perfTypeOf (variant : Variant , timeControl : TimeControl ): PerfType =
106
106
PerfPicker .perfType(speedOf(timeControl), variant, timeControl match {
107
107
case TimeControl .Correspondence (d) => d.some
108
108
case _ => none
109
- }) | PerfType .Correspondence
109
+ }).orElse {
110
+ (variant == FromPosition ) option perfTypeOf(chess.variant.Standard , timeControl)
111
+ }.| (PerfType .Correspondence )
110
112
111
113
private val idSize = 8
112
114
@@ -133,7 +135,7 @@ object Challenge {
133
135
_id = randomId,
134
136
status = Status .Created ,
135
137
variant = variant,
136
- initialFen = initialFen.ifTrue(variant == chess.variant. FromPosition ),
138
+ initialFen = initialFen.ifTrue(variant == FromPosition ),
137
139
timeControl = timeControl,
138
140
mode = mode,
139
141
colorChoice = colorChoice,
You can’t perform that action at this time.
0 commit comments