mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-01 20:04:02 +07:00
Extra validation
This commit is contained in:
parent
55a7089a3d
commit
3dae157a5e
@ -296,10 +296,11 @@ public class Schematics implements Loadable{
|
||||
/** Checks a schematic for deployment validity and adds it to the cache. */
|
||||
private void checkLoadout(Schematic s, boolean validate){
|
||||
Stile core = s.tiles.find(t -> t.block instanceof CoreBlock);
|
||||
int cores = s.tiles.count(t -> t.block instanceof CoreBlock);
|
||||
|
||||
//make sure a core exists, and that the schematic is small enough.
|
||||
if(core == null || (validate && (s.width > core.block.size + maxLoadoutSchematicPad *2 || s.height > core.block.size + maxLoadoutSchematicPad *2
|
||||
|| s.tiles.contains(t -> t.block.buildVisibility == BuildVisibility.sandboxOnly)))) return;
|
||||
|| s.tiles.contains(t -> t.block.buildVisibility == BuildVisibility.sandboxOnly || !t.block.unlocked()) || cores > 1))) return;
|
||||
|
||||
//place in the cache
|
||||
loadouts.get((CoreBlock)core.block, Seq::new).add(s);
|
||||
|
Loading…
Reference in New Issue
Block a user