Skip to content

Commit abc41e5

Browse files
committed
handle team sort roster team using loop
1 parent 8959fdd commit abc41e5

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

Source/Managers/MovableMan.cpp

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,10 +1292,9 @@ void MovableMan::Update() {
12921292
// ---TEMP---
12931293

12941294
// Reset the draw HUD roster line settings
1295-
m_SortTeamRoster[Activity::TeamOne] = false;
1296-
m_SortTeamRoster[Activity::TeamTwo] = false;
1297-
m_SortTeamRoster[Activity::TeamThree] = false;
1298-
m_SortTeamRoster[Activity::TeamFour] = false;
1295+
for (int team = Activity::TeamOne; team < Activity::MaxTeamCount; ++team) {
1296+
m_SortTeamRoster[team] = false;
1297+
}
12991298

13001299
// Move all last frame's alarm events into the proper buffer, and clear out the new one to fill up with this frame's
13011300
for (AlarmEvent* alarmEvent: m_AlarmEvents) {
@@ -1683,28 +1682,16 @@ void MovableMan::Update() {
16831682
// We've finished stuff that can interact with lua script, so it's the ideal time to start a gc run
16841683
g_LuaMan.StartAsyncGarbageCollection();
16851684

1686-
////////////////////////////////////////////////////////////////////////
16871685
// Draw the MO matter and IDs to their layers for next frame
16881686
m_DrawMOIDsTask = g_ThreadMan.GetPriorityThreadPool().submit([this]() {
16891687
UpdateDrawMOIDs();
16901688
});
16911689

1692-
////////////////////////////////////////////////////////////////////
1693-
// Draw the MO colors ONLY if this is a drawn update!
1694-
1695-
if (g_TimerMan.DrawnSimUpdate())
1696-
Draw(g_SceneMan.GetMOColorBitmap());
1697-
16981690
// Sort team rosters if necessary
1699-
{
1700-
if (m_SortTeamRoster[Activity::TeamOne])
1701-
m_ActorRoster[Activity::TeamOne].sort(MOXPosComparison());
1702-
if (m_SortTeamRoster[Activity::TeamTwo])
1703-
m_ActorRoster[Activity::TeamTwo].sort(MOXPosComparison());
1704-
if (m_SortTeamRoster[Activity::TeamThree])
1705-
m_ActorRoster[Activity::TeamThree].sort(MOXPosComparison());
1706-
if (m_SortTeamRoster[Activity::TeamFour])
1707-
m_ActorRoster[Activity::TeamFour].sort(MOXPosComparison());
1691+
for (int team = Activity::TeamOne; team < Activity::MaxTeamCount; ++team) {
1692+
if (m_SortTeamRoster[Activity::TeamOne]) {
1693+
m_ActorRoster[team].sort(MOXPosComparison());
1694+
}
17081695
}
17091696
}
17101697

0 commit comments

Comments
 (0)