Fixed #2632 (among other things)
This commit is contained in:
@@ -44,7 +44,7 @@ public class MinerAI extends AIController{
|
||||
}
|
||||
|
||||
if(ore != null){
|
||||
moveTo(ore, unit.type().range / 1.5f);
|
||||
moveTo(ore, unit.type().range / 2f);
|
||||
|
||||
if(unit.within(ore, unit.type().range)){
|
||||
miner.mineTile(ore);
|
||||
|
||||
@@ -31,7 +31,7 @@ public abstract class UnlockableContent extends MappableContent{
|
||||
|
||||
this.localizedName = Core.bundle.get(getContentType() + "." + this.name + ".name", this.name);
|
||||
this.description = Core.bundle.getOrNull(getContentType() + "." + this.name + ".description");
|
||||
this.unlocked = Core.settings != null && Core.settings.getBool(name + "-unlocked", false);
|
||||
this.unlocked = Core.settings != null && Core.settings.getBool(this.name + "-unlocked", false);
|
||||
}
|
||||
|
||||
public String displayDescription(){
|
||||
|
||||
@@ -61,6 +61,9 @@ public class Saves{
|
||||
//automatically assign sector save slots
|
||||
for(SaveSlot slot : saves){
|
||||
if(slot.getSector() != null){
|
||||
if(slot.getSector().save != null){
|
||||
Log.warn("Sector @ has two corresponding saves: @ and @", slot.getSector(), slot.getSector().save.file, slot.file);
|
||||
}
|
||||
slot.getSector().save = slot;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,10 @@ public class SaveIO{
|
||||
}
|
||||
}
|
||||
|
||||
public static void load(String saveName) throws SaveException{
|
||||
load(saveDirectory.child(saveName + ".msav"));
|
||||
}
|
||||
|
||||
public static void load(Fi file) throws SaveException{
|
||||
load(file, world.context);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Scripts implements Disposable{
|
||||
private final Seq<String> blacklist = Seq.with(".net.", "java.net", "files", "reflect", "javax", "rhino", "file", "channels", "jdk",
|
||||
"runtime", "util.os", "rmi", "security", "org.", "sun.", "beans", "sql", "http", "exec", "compiler", "process", "system",
|
||||
".awt", "socket", "classloader", "oracle", "invoke", "java.util.function", "java.util.stream", "org.");
|
||||
private final Seq<String> whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "mindustry.gen.", "mindustry.logic.", "mindustry.async.");
|
||||
private final Seq<String> whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "mindustry.gen.", "mindustry.logic.", "mindustry.async.", "saveio");
|
||||
private final Context context;
|
||||
private final Scriptable scope;
|
||||
private boolean errored;
|
||||
|
||||
@@ -275,6 +275,10 @@ public class Sector{
|
||||
Core.settings.put(key(key), value);
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return planet.name + "#" + id;
|
||||
}
|
||||
|
||||
/** Projects this sector onto a 4-corner square for use in map gen.
|
||||
* Allocates a new object. Do not call in the main loop. */
|
||||
private SectorRect makeRect(){
|
||||
|
||||
@@ -413,7 +413,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
}
|
||||
|
||||
if(shouldHide) hide();
|
||||
}).growX().padTop(2f).height(50f).minWidth(170f);
|
||||
}).growX().padTop(2f).height(50f).minWidth(170f).disabled(b -> state.rules.sector == sector && !state.isMenu());
|
||||
}
|
||||
|
||||
stable.pack();
|
||||
|
||||
Reference in New Issue
Block a user