Unstable 0.17.3.0
This commit is contained in:
@@ -754,9 +754,9 @@ namespace Barotrauma
|
||||
|
||||
try
|
||||
{
|
||||
IEnumerable<Character> crewCharacters = GetSessionCrewCharacters();
|
||||
ImmutableArray<Character> crewCharacters = GetSessionCrewCharacters().ToImmutableArray();
|
||||
|
||||
int prevMoney = (GameMode as CampaignMode)?.Bank.Balance ?? 0; // FIXME personal wallets - reward distribution
|
||||
int prevMoney = GetAmountOfMoney(crewCharacters);
|
||||
|
||||
foreach (Mission mission in missions)
|
||||
{
|
||||
@@ -828,7 +828,7 @@ namespace Barotrauma
|
||||
LogEndRoundStats(eventId);
|
||||
if (GameMode is CampaignMode campaignMode)
|
||||
{
|
||||
GameAnalyticsManager.AddDesignEvent(eventId + "MoneyEarned", campaignMode.Bank.Balance - prevMoney); // FIXME personal wallets - reward distrubiton
|
||||
GameAnalyticsManager.AddDesignEvent(eventId + "MoneyEarned", GetAmountOfMoney(crewCharacters) - prevMoney);
|
||||
campaignMode.TotalPlayTime += roundDuration;
|
||||
}
|
||||
#if CLIENT
|
||||
@@ -840,6 +840,17 @@ namespace Barotrauma
|
||||
{
|
||||
RoundEnding = false;
|
||||
}
|
||||
|
||||
int GetAmountOfMoney(IEnumerable<Character> crew)
|
||||
{
|
||||
if (!(GameMode is CampaignMode campaign)) { return 0; }
|
||||
|
||||
return GameMain.NetworkMember switch
|
||||
{
|
||||
null => campaign.Bank.Balance,
|
||||
_ => crew.Sum(c => c.Wallet.Balance) + campaign.Bank.Balance
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public void LogEndRoundStats(string eventId)
|
||||
|
||||
Reference in New Issue
Block a user