Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit a529576

Browse files
committed
Improve the wording of craft return messages
1 parent 7e63249 commit a529576

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Entities/Activity.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -804,24 +804,28 @@ void Activity::Clear() {
804804
}
805805

806806
float totalValue = orbitedCraft->GetTotalValue(0, foreignCostMult, nativeCostMult);
807-
std::snprintf(messageString, sizeof(messageString), "Returned Craft + Cargo added %.0f oz to Funds!", totalValue);
808807

808+
std::string craftText = "Returned craft";
809+
if (!orbitedCraft->IsInventoryEmpty()) { craftText += " + cargo"; }
810+
811+
if (totalValue > 0) {
812+
m_TeamFunds[orbitedCraftTeam] += totalValue;
813+
std::snprintf(messageString, sizeof(messageString), "%s added %.0f oz to funds!", craftText.c_str(), totalValue);
814+
}
809815
for (int player = Players::PlayerOne; player < Players::MaxPlayerCount; ++player) {
810816
if (m_IsActive[player]) {
811817
if (brainOnBoard && orbitedCraft == GetPlayerBrain(static_cast<Players>(player))) {
812818
m_BrainEvacuated[player] = true;
813-
std::snprintf(messageString, sizeof(messageString), "YOUR BRAIN HAS BEEN EVACUATED BACK INTO ORBIT!");
814-
}
815-
816-
if (m_Team[player] == orbitedCraftTeam) {
819+
g_FrameMan.ClearScreenText(ScreenOfPlayer(ScreenOfPlayer(static_cast<Players>(player))));
820+
g_FrameMan.SetScreenText("YOUR BRAIN HAS BEEN EVACUATED BACK INTO ORBIT!", ScreenOfPlayer(static_cast<Players>(player)), 0, 3500);
821+
} else if (m_Team[player] == orbitedCraftTeam && totalValue > 0) {
817822
g_FrameMan.ClearScreenText(ScreenOfPlayer(ScreenOfPlayer(static_cast<Players>(player))));
818823
g_FrameMan.SetScreenText(messageString, ScreenOfPlayer(static_cast<Players>(player)), 0, 3500);
819824
m_MessageTimer[player].Reset();
820825
}
821826
}
822827
}
823828

824-
m_TeamFunds[orbitedCraftTeam] += totalValue;
825829
orbitedCraft->SetGoldCarried(0);
826830
orbitedCraft->SetHealth(orbitedCraft->GetMaxHealth());
827831

0 commit comments

Comments
 (0)