Fixed being able to gain karma by welding fixed walls

This commit is contained in:
Joonas Rikkonen
2018-03-09 12:47:14 +02:00
parent 03fa2a2e1b
commit 738910e123
@@ -687,9 +687,10 @@ namespace Barotrauma
{
if (Submarine != null && Submarine.GodMode) return;
if (!prefab.Body) return;
if (!MathUtils.IsValid(damage)) return;
damage = MathHelper.Clamp(damage, 0.0f, prefab.Health);
if (GameMain.Server != null && damage != sections[sectionIndex].damage)
{
GameMain.Server.CreateEntityEvent(this);
@@ -756,7 +757,7 @@ namespace Barotrauma
bool hadHole = SectionBodyDisabled(sectionIndex);
sections[sectionIndex].damage = MathHelper.Clamp(damage, 0.0f, prefab.Health);
if (sections[sectionIndex].damage < prefab.Health) //otherwise it's possible to infinitely gain karma by welding fixed things
if (damageDiff != 0.0f) //otherwise it's possible to infinitely gain karma by welding fixed things
AdjustKarma(attacker, damageDiff);
bool hasHole = SectionBodyDisabled(sectionIndex);