From 7860262a3b88cfe52b1ce24f18cdb25f225952b5 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 18 Aug 2023 23:28:31 +1000 Subject: [PATCH] Fix MaterialItem steps being in reverse Also multiplied steps for reliability with diagonals --- source/game/items/StarMaterialItem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/game/items/StarMaterialItem.cpp b/source/game/items/StarMaterialItem.cpp index 0d3c9a5..99cdead 100644 --- a/source/game/items/StarMaterialItem.cpp +++ b/source/game/items/StarMaterialItem.cpp @@ -108,13 +108,13 @@ void MaterialItem::fire(FireMode mode, bool shifting, bool edgeTriggered) { magnitude = 32; } - steps = (int)ceil(magnitude); + steps = (int)ceil(magnitude * (Constants::pi / 2)); } unsigned total = 0; bool fail = true; for (int i = 0; i != steps; ++i) { - auto placementOrigin = aimPosition + diff * ((float)i / steps); + auto placementOrigin = aimPosition + diff * (1.0f - ((float)i / steps)); for (Vec2I pos : tileAreaBrush(radius, placementOrigin, true)) modifications.append({ pos, PlaceMaterial{layer, materialId(), placementHueShift(pos)} });