Merge branch 'master' into new-netcode

Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Characters/Animation/HumanoidAnimController.cs
	Subsurface/Source/Characters/Character.cs
	Subsurface/Source/Items/Components/Door.cs
	Subsurface/Source/Items/Components/Power/PowerContainer.cs
	Subsurface/Source/Items/Components/Signal/Wire.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Networking/ChatMessage.cs
	Subsurface/Source/Networking/GameClient.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Networking/GameServerLogin.cs
	Subsurface/Source/Networking/GameServerSettings.cs
	Subsurface/Source/Networking/NetworkMember.cs
This commit is contained in:
Regalis
2016-11-24 19:43:45 +02:00
93 changed files with 1872 additions and 683 deletions

View File

@@ -258,7 +258,6 @@ namespace Barotrauma
}
}
if (prefab.CastShadow)
{
GenerateConvexHull();
@@ -267,6 +266,11 @@ namespace Barotrauma
InsertToList();
}
public override MapEntity Clone()
{
return new Structure(rect, prefab, Submarine);
}
private void CreateStairBodies()
{
bodies = new List<Body>();
@@ -486,14 +490,13 @@ namespace Barotrauma
Draw(spriteBatch, false, false, damageEffect);
}
private static float prevCutoff;
private void Draw(SpriteBatch spriteBatch, bool editing, bool back = true, Effect damageEffect = null)
{
if (prefab.sprite == null) return;
Color color = (isHighlighted) ? Color.Orange : Color.White;
if (isSelected && editing)
if (IsSelected && editing)
{
color = Color.Red;
@@ -525,14 +528,14 @@ namespace Barotrauma
{
float newCutoff = Math.Min((sections[i].damage / prefab.MaxHealth), 0.65f);
if (Math.Abs(newCutoff - prevCutoff) > 0.01f)
if (Math.Abs(newCutoff - Submarine.DamageEffectCutoff) > 0.01f)
{
damageEffect.Parameters["aCutoff"].SetValue(newCutoff);
damageEffect.Parameters["cCutoff"].SetValue(newCutoff * 1.2f);
damageEffect.CurrentTechnique.Passes[0].Apply();
prevCutoff = newCutoff;
Submarine.DamageEffectCutoff = newCutoff;
}
}
@@ -760,11 +763,10 @@ namespace Barotrauma
if(CastShadow) GenerateConvexHull();
}
sections[sectionIndex].gap.Open = (damage / prefab.MaxHealth - 0.5f) * 2.0f;
}
if (sections[sectionIndex].gap != null)
sections[sectionIndex].gap.Open = (damage/prefab.MaxHealth - 0.5f)*2;
bool hadHole = SectionBodyDisabled(sectionIndex);
sections[sectionIndex].damage = MathHelper.Clamp(damage, 0.0f, prefab.MaxHealth);