@@ -226,7 +226,8 @@ function dcsbot.startMission(json)
226226 json .result = net .missionlist_run (json .id )
227227 if json .result == true then
228228 utils .saveSettings ({
229- listStartIndex = json .id
229+ listStartIndex = json .id ,
230+ current = json .id
230231 })
231232 end
232233 else
269270function dcsbot .setStartIndex (json )
270271 log .write (' DCSServerBot' , log .DEBUG , ' Mission: setStartIndex()' )
271272 utils .saveSettings ({
272- listStartIndex = json .id
273+ listStartIndex = json .id ,
274+ current = json .id
273275 })
274276end
275277
@@ -319,15 +321,11 @@ end
319321function dcsbot .replaceMission (json )
320322 log .write (' DCSServerBot' , log .DEBUG , ' Mission: replaceMission()' )
321323 local current_missions = net .missionlist_get ()
324+ local listStartIndex = current_missions [" listStartIndex" ]
322325 net .missionlist_delete (tonumber (json .index ))
323326 net .missionlist_append (json .path )
324327 net .missionlist_move (# current_missions [" missionList" ], tonumber (json .index ))
325328 current_missions = net .missionlist_get ()
326- -- workaround DCS bug
327- local listStartIndex = current_missions [" listStartIndex" ]
328- if # current_missions [' missionList' ] < listStartIndex then
329- listStartIndex = 1
330- end
331329 utils .saveSettings ({
332330 missionList = current_missions [" missionList" ],
333331 listStartIndex = listStartIndex
0 commit comments