mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-01 02:14:27 +07:00
Median error fix
This commit is contained in:
parent
469a49b3d6
commit
bae64cb98a
@ -50,8 +50,7 @@ public class MedianFilter extends GenerateFilter{
|
||||
floors.sort();
|
||||
blocks.sort();
|
||||
|
||||
int index = Math.min((int)(floors.size * percentile), floors.size - 1);
|
||||
int floor = floors.get(index), block = blocks.get(index);
|
||||
int floor = floors.get(Math.min((int)(floors.size * percentile), floors.size - 1)), block = blocks.get(Math.min((int)(blocks.size * percentile), blocks.size - 1));
|
||||
|
||||
in.floor = content.block(floor);
|
||||
if(!content.block(block).synthetic() && !in.block.synthetic()) in.block = content.block(block);
|
||||
|
Loading…
Reference in New Issue
Block a user