Merge remote-tracking branch 'barotrauma/master' into new-netcode

# Conflicts:
#	Subsurface/Properties/AssemblyInfo.cs
#	Subsurface/Source/Characters/AI/EnemyAIController.cs
#	Subsurface/Source/Characters/AICharacter.cs
#	Subsurface/Source/Characters/Character.cs
#	Subsurface/Source/Items/Components/Signal/Connection.cs
#	Subsurface/Source/Items/Item.cs
#	Subsurface/Source/Map/Structure.cs
#	Subsurface/Source/Networking/GameClient.cs
#	Subsurface/Source/Networking/GameServer.cs
#	Subsurface/Source/Screens/NetLobbyScreen.cs
This commit is contained in:
juanjp600
2016-11-05 18:18:20 -03:00
57 changed files with 454 additions and 362 deletions
+6 -6
View File
@@ -585,9 +585,9 @@ namespace Barotrauma
var soundElements = doc.Root.Elements("sound").ToList();
if (soundElements.Any())
{
sounds = new Sound[soundElements.Count()];
soundStates = new AIController.AiState[soundElements.Count()];
soundRange = new float[soundElements.Count()];
sounds = new Sound[soundElements.Count];
soundStates = new AIController.AiState[soundElements.Count];
soundRange = new float[soundElements.Count];
int i = 0;
foreach (XElement soundElement in soundElements)
{
@@ -868,7 +868,7 @@ namespace Barotrauma
{
attackPos = Submarine.LastPickedPosition;
if (body != null && body.UserData is Submarine)
if (body.UserData is Submarine)
{
var sub = ((Submarine)body.UserData);
@@ -1538,10 +1538,10 @@ namespace Barotrauma
if (sounds == null || !sounds.Any()) return;
var matchingSoundStates = soundStates.Where(x => x == state).ToList();
int selectedSound = Rand.Int(matchingSoundStates.Count());
int selectedSound = Rand.Int(matchingSoundStates.Count);
int n = 0;
for (int i = 0; i < sounds.Count(); i++)
for (int i = 0; i < sounds.Length; i++)
{
if (soundStates[i] != state) continue;
if (n == selectedSound && sounds[i]!=null)