Skip to content

Commit ab06261

Browse files
fix custom engines not running, set standard PvE time Parameter to 1 second
1 parent acbd326 commit ab06261

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

src/renderer/components/PVLines.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ export default {
107107
if (this.active && this.PvE && !this.turn) {
108108
if (this.PvEValue === 'time') {
109109
if (this.enginetime === (this.PvEInput)) {
110-
this.onClick(this.lines[0])
110+
if (this.lines[0] != null) {
111+
this.onClick(this.lines[0])
112+
}
111113
}
112114
} else if (this.PvEValue === 'nodes') {
113115
if (this.enginetime === 60000) {

src/renderer/components/PvESwitch.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ export default {
2020
watch: {
2121
turn () {
2222
if (this.turn && this.PvE) {
23-
this.$store.dispatch('stopEnginePvE')
24-
} else if (!this.turn && this.PvE) {
25-
this.$store.dispatch('restartEngine')
23+
this.$store.dispatch('resetEngineData')
24+
this.$store.commit('resetEngineTime')
2625
}
2726
}
2827
},

src/renderer/components/RoundedSwitch.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default {
2020
},
2121
watch: {
2222
active () {
23-
if ((this.active && !this.PvE) || (this.active && this.PvE && !this.turn)) {
24-
this.$store.dispatch('restartEngine')
23+
if (this.active && !this.turn && this.PvE) {
24+
this.$store.dispatch('goEnginePvE')
2525
}
2626
}
2727
},

src/renderer/components/SettingsTab.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@
126126
v-model.number="PvEInput"
127127
type="number"
128128
:step="1"
129-
:min="5"
130-
:max="45"
129+
:min="1"
131130
class="input"
132131
>
133132
</td>
@@ -179,7 +178,7 @@ export default {
179178
value: 'time',
180179
options: ['time', 'nodes', 'depth'],
181180
settingsName: 'Time in seconds',
182-
PvEInput: 5
181+
PvEInput: 1
183182
}
184183
},
185184
computed: {
@@ -204,7 +203,7 @@ export default {
204203
} else if (payload === 'time') {
205204
this.settingsName = 'Time in seconds'
206205
this.value = 'time'
207-
this.PvEInput = 5
206+
this.PvEInput = 1
208207
} else if (payload === 'depth') {
209208
this.PvEInput = 20
210209
this.settingsName = 'depth of'
@@ -236,7 +235,7 @@ export default {
236235
case 'time':
237236
this.$store.dispatch(
238237
'setPvEParam',
239-
'go btime ' + this.PvEInput * 1000
238+
'go movetime ' + this.PvEInput * 1000
240239
)
241240
this.$store.dispatch('setPvEInput', this.PvEInput * 1000)
242241
break

src/renderer/store.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ export const store = new Vuex.Store({
108108
initialized: false,
109109
active: false,
110110
PvE: false,
111-
PvEParam: 'go btime 5000',
111+
PvEParam: 'go movetime 1000',
112112
PvEValue: 'time',
113-
PvEInput: 5000,
113+
PvEInput: 1000,
114114
turn: true,
115115
fen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
116116
lastFen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', // to track the end of the current line
@@ -612,7 +612,6 @@ export const store = new Vuex.Store({
612612
goEnginePvE (context) {
613613
engine.send(context.getters.PvEParam)
614614
context.commit('setEngineClock')
615-
context.commit('active', true)
616615
},
617616
setActiveTrue (context) {
618617
context.commit('active', true)
@@ -628,7 +627,12 @@ export const store = new Vuex.Store({
628627
},
629628
PvEfalse (context) {
630629
context.commit('PvE', false)
631-
context.dispatch('stopEngine')
630+
if (!context.getters.turn) {
631+
context.dispatch('stopEngine')
632+
} else {
633+
context.commit('resetEngineTime')
634+
context.commit('active', false)
635+
}
632636
context.dispatch('resetEngineData')
633637
},
634638
stopEngine (context) {
@@ -643,7 +647,6 @@ export const store = new Vuex.Store({
643647
context.dispatch('position')
644648
context.dispatch('goEngine')
645649
} else if (context.getters.active && context.getters.PvE && !context.getters.turn) {
646-
context.dispatch('stopEngine')
647650
context.dispatch('position')
648651
context.dispatch('goEnginePvE')
649652
}

0 commit comments

Comments
 (0)