Fix MaterialItem steps being in reverse
Also multiplied steps for reliability with diagonals
This commit is contained in:
parent
f6f91b18e8
commit
7860262a3b
@ -108,13 +108,13 @@ void MaterialItem::fire(FireMode mode, bool shifting, bool edgeTriggered) {
|
|||||||
magnitude = 32;
|
magnitude = 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
steps = (int)ceil(magnitude);
|
steps = (int)ceil(magnitude * (Constants::pi / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned total = 0;
|
unsigned total = 0;
|
||||||
bool fail = true;
|
bool fail = true;
|
||||||
for (int i = 0; i != steps; ++i) {
|
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))
|
for (Vec2I pos : tileAreaBrush(radius, placementOrigin, true))
|
||||||
modifications.append({ pos, PlaceMaterial{layer, materialId(), placementHueShift(pos)} });
|
modifications.append({ pos, PlaceMaterial{layer, materialId(), placementHueShift(pos)} });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user