Unstable 0.1300.0.8
This commit is contained in:
@@ -3752,11 +3752,11 @@ namespace Barotrauma.Networking
|
||||
|
||||
private Client FindClientWithJobPreference(List<Client> clients, JobPrefab job, bool forceAssign = false)
|
||||
{
|
||||
int bestPreference = 0;
|
||||
int bestPreference = int.MaxValue;
|
||||
Client preferredClient = null;
|
||||
foreach (Client c in clients)
|
||||
{
|
||||
if (c.Karma < job.MinKarma) { continue; }
|
||||
if (ServerSettings.KarmaEnabled && c.Karma < job.MinKarma) { continue; }
|
||||
int index = c.JobPreferences.IndexOf(c.JobPreferences.Find(j => j.First == job));
|
||||
if (index > -1 && index < bestPreference)
|
||||
{
|
||||
|
||||
@@ -18,10 +18,17 @@ namespace Barotrauma.Networking
|
||||
if (!c.InGame) { continue; }
|
||||
if (c.SpectateOnly && (GameMain.Server.ServerSettings.AllowSpectating || GameMain.Server.OwnerConnection == c.Connection)) { continue; }
|
||||
if (c.Character != null && !c.Character.IsDead) { continue; }
|
||||
|
||||
|
||||
//don't allow respawn if the client already has a character (they'll regain control once they're in sync)
|
||||
var matchingData = campaign?.GetClientCharacterData(c);
|
||||
if (matchingData != null && matchingData.HasSpawned &&
|
||||
Character.CharacterList.Any(c => c.Info == matchingData.CharacterInfo && !c.IsDead))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (UseRespawnPrompt)
|
||||
{
|
||||
var matchingData = campaign?.GetClientCharacterData(c);
|
||||
if (matchingData != null && matchingData.HasSpawned)
|
||||
{
|
||||
if (!c.WaitForNextRoundRespawn.HasValue || c.WaitForNextRoundRespawn.Value) { continue; }
|
||||
|
||||
Reference in New Issue
Block a user