Fixed being able to gain karma by welding fixed walls
This commit is contained in:
@@ -687,9 +687,10 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (Submarine != null && Submarine.GodMode) return;
|
if (Submarine != null && Submarine.GodMode) return;
|
||||||
if (!prefab.Body) return;
|
if (!prefab.Body) return;
|
||||||
|
|
||||||
if (!MathUtils.IsValid(damage)) return;
|
if (!MathUtils.IsValid(damage)) return;
|
||||||
|
|
||||||
|
damage = MathHelper.Clamp(damage, 0.0f, prefab.Health);
|
||||||
|
|
||||||
if (GameMain.Server != null && damage != sections[sectionIndex].damage)
|
if (GameMain.Server != null && damage != sections[sectionIndex].damage)
|
||||||
{
|
{
|
||||||
GameMain.Server.CreateEntityEvent(this);
|
GameMain.Server.CreateEntityEvent(this);
|
||||||
@@ -756,7 +757,7 @@ namespace Barotrauma
|
|||||||
bool hadHole = SectionBodyDisabled(sectionIndex);
|
bool hadHole = SectionBodyDisabled(sectionIndex);
|
||||||
sections[sectionIndex].damage = MathHelper.Clamp(damage, 0.0f, prefab.Health);
|
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);
|
AdjustKarma(attacker, damageDiff);
|
||||||
|
|
||||||
bool hasHole = SectionBodyDisabled(sectionIndex);
|
bool hasHole = SectionBodyDisabled(sectionIndex);
|
||||||
|
|||||||
Reference in New Issue
Block a user