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

Method Service_Promotion_Check

Source/Fodder.cpp:10008–10035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10006}
10007
10008void cFodder::Service_Promotion_Check() {
10009 auto* Troop = &mGame_Data.mSoldiers_Allocated[0];
10010
10011 if (!mService_Draw_List.size())
10012 return;
10013
10014 for( size_t x = 0; x < mService_Draw_List.size() - 1; ++x) {
10015 auto Draw = &mService_Draw_List[x];
10016
10017 if (Draw->mSpriteType != 2)
10018 continue;
10019
10020 int16 newRank = Troop->GetPromotedRank();
10021 if (Troop->mRecruitID == -1) {
10022 ++Troop;
10023 --x;
10024 continue;
10025 }
10026 ++Troop;
10027 ++x;
10028
10029 if (Draw->mY >= (getCameraHeight() - 8) / 2)
10030 continue;
10031
10032 (Draw+0)->mFrame = newRank;
10033 (Draw+1)->mFrame = newRank;
10034 }
10035}
10036
10037void cFodder::Service_Draw_List() {
10038

Callers

nothing calls this directly

Calls 2

GetPromotedRankMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected