Store building pos instead of start pos

Fix an explosion hitting the same building multiple times if it's larger than 1x1.
This commit is contained in:
MEEP of Faith
2022-09-06 17:32:04 -07:00
parent 6d2251c52d
commit bfd04e2683

View File

@@ -545,7 +545,7 @@ public class Damage{
float mult = (1f-(Mathf.dst2(startX, startY, x, y) / rad2) + edgeScale) / (1f + edgeScale);
float next = damage * mult - dealt;
//register damage dealt
int p = Point2.pack(startX, startY);
int p = build.pos();
damages.put(p, Math.max(damages.get(p), next));
//register as hit
dealt += build.health;