Build 0.21.6.0 (1.0 pre-patch)
This commit is contained in:
@@ -27,12 +27,9 @@ namespace Barotrauma
|
||||
AnyOneAllowedToManageCampaign(permissions);
|
||||
}
|
||||
|
||||
public bool AllowedToManageWallets(Client client)
|
||||
public static bool AllowedToManageWallets(Client client)
|
||||
{
|
||||
return
|
||||
client.HasPermission(ClientPermissions.ManageCampaign) ||
|
||||
client.HasPermission(ClientPermissions.ManageMoney) ||
|
||||
IsOwner(client);
|
||||
return AllowedToManageCampaign(client, ClientPermissions.ManageMoney);
|
||||
}
|
||||
|
||||
public override void ShowStartMessage()
|
||||
|
||||
+9
-2
@@ -109,15 +109,22 @@ namespace Barotrauma
|
||||
return AccountId == other.AccountId && other.ClientAddress == ClientAddress;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
itemData = null;
|
||||
healthData = null;
|
||||
WalletData = null;
|
||||
}
|
||||
|
||||
public void SpawnInventoryItems(Character character, Inventory inventory)
|
||||
{
|
||||
if (character == null)
|
||||
{
|
||||
throw new System.InvalidOperationException($"Failed to spawn inventory items. Character was null.");
|
||||
throw new InvalidOperationException($"Failed to spawn inventory items. Character was null.");
|
||||
}
|
||||
if (itemData == null)
|
||||
{
|
||||
throw new System.InvalidOperationException($"Failed to spawn inventory items for the character \"{character.Name}\". No saved inventory data.");
|
||||
throw new InvalidOperationException($"Failed to spawn inventory items for the character \"{character.Name}\". No saved inventory data.");
|
||||
}
|
||||
character.SpawnInventoryItems(inventory, itemData.FromPackage(null));
|
||||
}
|
||||
|
||||
+13
-7
@@ -146,7 +146,7 @@ namespace Barotrauma
|
||||
{
|
||||
NextLevel = map.SelectedConnection?.LevelData ?? map.CurrentLocation.LevelData;
|
||||
MirrorLevel = false;
|
||||
GameMain.Server.StartGame();
|
||||
GameMain.Server.TryStartGame();
|
||||
}
|
||||
|
||||
public static void StartCampaignSetup()
|
||||
@@ -240,9 +240,7 @@ namespace Barotrauma
|
||||
//reduce skills if the character has died
|
||||
if (characterInfo.CauseOfDeath != null && characterInfo.CauseOfDeath.Type != CauseOfDeathType.Disconnected)
|
||||
{
|
||||
RespawnManager.ReduceCharacterSkills(characterInfo);
|
||||
characterInfo.RemoveSavedStatValuesOnDeath();
|
||||
characterInfo.CauseOfDeath = null;
|
||||
characterInfo.ApplyDeathEffects();
|
||||
}
|
||||
c.CharacterInfo = characterInfo;
|
||||
SetClientCharacterData(c);
|
||||
@@ -254,13 +252,21 @@ namespace Barotrauma
|
||||
{
|
||||
if (data.HasSpawned && !GameMain.Server.ConnectedClients.Any(c => data.MatchesClient(c)))
|
||||
{
|
||||
var character = Character.CharacterList.Find(c => c.Info == data.CharacterInfo && !c.IsHusk);
|
||||
if (character != null && (!character.IsDead || character.CauseOfDeath?.Type == CauseOfDeathType.Disconnected))
|
||||
var character = Character.CharacterList.Find(c => c.Info == data.CharacterInfo && !c.IsHusk);
|
||||
if (character != null &&
|
||||
(!character.IsDead || character.CauseOfDeath?.Type == CauseOfDeathType.Disconnected))
|
||||
{
|
||||
//character still alive (or killed by Disconnect) -> save it as-is
|
||||
characterData.RemoveAll(cd => cd.IsDuplicate(data));
|
||||
data.Refresh(character);
|
||||
characterData.Add(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
//character dead or removed -> reduce skills, remove items, health data, etc
|
||||
data.CharacterInfo.ApplyDeathEffects();
|
||||
data.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +401,7 @@ namespace Barotrauma
|
||||
yield return new WaitForSeconds(EndTransitionDuration * 0.5f);
|
||||
}
|
||||
|
||||
GameMain.Server.StartGame();
|
||||
GameMain.Server.TryStartGame();
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user