Skip to content

Commit

Permalink
fixed logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauge committed Jul 24, 2024
1 parent 5014e9a commit 12dd4a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ShrapnelDamageV2/Data/Scripts/shrapnel/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using VRage.Game;
using VRage.Game.Components;
using VRage.Game.ModAPI;
using VRage.Utils;

namespace Shrapnel
{
Expand All @@ -24,7 +25,7 @@ public void ProcessDamage(object target, ref MyDamageInformation info)

if (info.Type == MyDamageType.Weapon || info.Type == MyDamageType.Bullet || info.Type == MyDamageType.Rocket)
{
if (slim.Integrity >= info.Amount) return;
if (slim.Integrity <= info.Amount) return;

float overkill = info.Amount - slim.Integrity;
info.Amount = slim.Integrity;
Expand Down Expand Up @@ -59,6 +60,8 @@ public override void UpdateBeforeSimulation()
tasks++;
ShrapnelData data = queue.Dequeue();
float count = 1f / (float)data.Neighbours.Count;

//MyLog.Default.Info($"queue: {queue.Count} - overkill: {data.OverKill}, spread: {data.OverKill * count}");
foreach (IMySlimBlock neighbour in data.Neighbours)
{
if (neighbour == null) continue;
Expand Down

0 comments on commit 12dd4a2

Please sign in to comment.