v1.0.7.0 (Full Release)
This commit is contained in:
@@ -79,10 +79,10 @@ namespace Barotrauma
|
||||
if (passed)
|
||||
{
|
||||
Wallet fromWallet = From == null ? (GameMain.GameSession.GameMode as MultiPlayerCampaign)?.Bank : From.Character?.Wallet;
|
||||
if (fromWallet.TryDeduct(TransferAmount))
|
||||
if (fromWallet != null && fromWallet.TryDeduct(TransferAmount))
|
||||
{
|
||||
Wallet toWallet = To == null ? (GameMain.GameSession.GameMode as MultiPlayerCampaign)?.Bank : To.Character?.Wallet;
|
||||
toWallet.Give(TransferAmount);
|
||||
toWallet?.Give(TransferAmount);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -203,12 +203,16 @@ namespace Barotrauma
|
||||
// Do not take unanswered into account for total
|
||||
int yes = eligibleClients.Count(c => c.GetVote<int>(ActiveVote.VoteType) == 2);
|
||||
int no = eligibleClients.Count(c => c.GetVote<int>(ActiveVote.VoteType) == 1);
|
||||
int total = Math.Max(yes + no, 1);
|
||||
|
||||
bool passed =
|
||||
yes / (float)total >= GameMain.NetworkMember.ServerSettings.VoteRequiredRatio ||
|
||||
inGameClients.Count() == 1;
|
||||
int total = yes + no;
|
||||
|
||||
bool passed = false;
|
||||
//total can be zero if the client who initiated the vote has left
|
||||
if (total > 0)
|
||||
{
|
||||
passed =
|
||||
yes / (float)total >= GameMain.NetworkMember.ServerSettings.VoteRequiredRatio ||
|
||||
inGameClients.Count() == 1;
|
||||
}
|
||||
ActiveVote.Finish(this, passed);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user