MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / GUI_Sidebar_SelectedTroops_Count

Method GUI_Sidebar_SelectedTroops_Count

Source/GUI_Element.cpp:528–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528int16 cFodder::GUI_Sidebar_SelectedTroops_Count() {
529
530 int16 Data10 = 0;
531 for (auto& Troop : mGame_Data.mSoldiers_Allocated) {
532
533 if (Troop.mSprite == INVALID_SPRITE_PTR || Troop.mSprite == 0)
534 continue;
535
536 if (mSquad_Selected != Troop.mSprite->field_32)
537 continue;
538
539 if (!(Troop.mSelected & 1))
540 continue;
541
542 Data10++;
543 }
544
545 int16 Data0 = mSquads_TroopCount[mSquad_Selected];
546 if (Data10 == Data0)
547 return 0;
548
549 if (Data10)
550 return Data10;
551
552 Data0 = 0;
553 return 0;
554}
555
556void cFodder::GUI_Sidebar_Setup() {
557

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected