fix: 부대 편성에서 부대장 집합 순서로 정렬 필요

This commit is contained in:
2022-07-31 19:50:52 +09:00
parent e8911d40df
commit 2f0cd32c18
+11 -1
View File
@@ -302,7 +302,17 @@ async function refresh() {
troopList.value = new Map();
for (const { id: troopLeaderID, name: troopName, turntime: troopTurntime, reservedCommand } of troops) {
const sortedTroops= troops.sort((lhs, rhs) => {
if(lhs.turntime < rhs.turntime) {
return -1;
}
if(lhs.turntime > rhs.turntime) {
return 1;
}
return lhs.id - rhs.id;
});
for (const { id: troopLeaderID, name: troopName, turntime: troopTurntime, reservedCommand } of sortedTroops) {
if (!generalList.value.has(troopLeaderID)) {
toasts.warning({
title: "경고",