Reduce chance of index error
This commit is contained in:
parent
a2ee743b26
commit
87c5fe3e0e
@ -155,14 +155,13 @@ export default class Player {
|
|||||||
planeId: 10001
|
planeId: 10001
|
||||||
}
|
}
|
||||||
const LINEUPS = 6;
|
const LINEUPS = 6;
|
||||||
let slot = 0;
|
|
||||||
dataObj.lineup = {
|
dataObj.lineup = {
|
||||||
curIndex: 0,
|
curIndex: 0,
|
||||||
lineups: {}
|
lineups: {}
|
||||||
}
|
}
|
||||||
for (let i = 0; i <= LINEUPS; i++) {
|
for (let i = 0; i <= LINEUPS; i++) {
|
||||||
const copy = baseLineup;
|
const copy = baseLineup;
|
||||||
copy.index = slot++;
|
copy.index = 0;
|
||||||
dataObj.lineup.lineups[i] = copy;
|
dataObj.lineup.lineups[i] = copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user