Merge branch 'master' of bitbucket.org:Regalis11/barotrauma

This commit is contained in:
Sebastian Broberg
2016-08-28 16:42:34 +02:00
5 changed files with 76 additions and 34 deletions
+9 -9
View File
@@ -1,18 +1,18 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Barotrauma.Items.Components;
using Barotrauma.Networking;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Dynamics.Contacts;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Barotrauma.Networking;
using System;
using Barotrauma.Items.Components;
using System.ComponentModel;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Dynamics.Contacts;
using System.ComponentModel;
using System.Linq;
using System.Xml.Linq;
namespace Barotrauma
{
@@ -648,7 +648,7 @@ namespace Barotrauma
public AttackResult AddDamage(IDamageable attacker, Vector2 worldPosition, Attack attack, float deltaTime, bool playSound = true)
{
float damageAmount = attack.GetDamage(deltaTime);
float damageAmount = attack.GetStructureDamage(deltaTime);
Condition -= damageAmount;
return new AttackResult(damageAmount, 0.0f, false);
+2 -2
View File
@@ -1474,13 +1474,13 @@ namespace Barotrauma.Networking
similarity += sender.ChatSpamSpeed * 0.05f; //the faster messages are being sent, the faster the filter will block
for (int i = 0; i < sender.ChatMessages.Count; i++)
{
float closeFactor = 1.0f / (20.0f - i);
float closeFactor = 1.0f / (sender.ChatMessages.Count - i);
int levenshteinDist = ToolBox.LevenshteinDistance(message.Text, sender.ChatMessages[i]);
similarity += Math.Max((message.Text.Length - levenshteinDist) / message.Text.Length * closeFactor, 0.0f);
}
if (similarity > 6.0f)
if (similarity > 5.0f)
{
sender.ChatSpamCount++;