Closes Anuken/Mindustry-Suggestions/issues/5842
This commit is contained in:
@@ -58,7 +58,7 @@ public class Vars implements Loadable{
|
|||||||
/** If true, mod code and scripts do not run. For internal testing only. This WILL break mods if enabled. */
|
/** If true, mod code and scripts do not run. For internal testing only. This WILL break mods if enabled. */
|
||||||
public static boolean skipModCode = false;
|
public static boolean skipModCode = false;
|
||||||
/** Default accessible content types used for player-selectable icons. */
|
/** Default accessible content types used for player-selectable icons. */
|
||||||
public static final ContentType[] defaultContentIcons = {ContentType.item, ContentType.liquid, ContentType.block, ContentType.unit};
|
public static final ContentType[] defaultContentIcons = {ContentType.item, ContentType.liquid, ContentType.block, ContentType.unit, ContentType.status};
|
||||||
/** Default rule environment. */
|
/** Default rule environment. */
|
||||||
public static final int defaultEnv = Env.terrestrial | Env.spores | Env.groundOil | Env.groundWater | Env.oxygen;
|
public static final int defaultEnv = Env.terrestrial | Env.spores | Env.groundOil | Env.groundWater | Env.oxygen;
|
||||||
/** Wall darkness radius. */
|
/** Wall darkness radius. */
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
//region io
|
//region io
|
||||||
|
|
||||||
public final void writeBase(Writes write){
|
public final void writeBase(Writes write){
|
||||||
|
//TODO: this code is a legacy mess; in future versions, it should be replaced with a different system that has a 1-integer module bitmask + byte version.
|
||||||
boolean writeVisibility = state.rules.fog && visibleFlags != 0;
|
boolean writeVisibility = state.rules.fog && visibleFlags != 0;
|
||||||
|
|
||||||
write.f(health);
|
write.f(health);
|
||||||
@@ -237,7 +238,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
if((moduleBits & 1) != 0) (items == null ? new ItemModule() : items).read(read, legacy);
|
if((moduleBits & 1) != 0) (items == null ? new ItemModule() : items).read(read, legacy);
|
||||||
if((moduleBits & (1 << 1)) != 0) (power == null ? new PowerModule() : power).read(read, legacy);
|
if((moduleBits & (1 << 1)) != 0) (power == null ? new PowerModule() : power).read(read, legacy);
|
||||||
if((moduleBits & (1 << 2)) != 0) (liquids == null ? new LiquidModule() : liquids).read(read, legacy);
|
if((moduleBits & (1 << 2)) != 0) (liquids == null ? new LiquidModule() : liquids).read(read, legacy);
|
||||||
//1 << 3 is skipped (oldconsume module)
|
//1 << 3 is skipped (old consume module)
|
||||||
if((moduleBits & (1 << 4)) != 0){
|
if((moduleBits & (1 << 4)) != 0){
|
||||||
timeScale = read.f();
|
timeScale = read.f();
|
||||||
timeScaleDuration = read.f();
|
timeScaleDuration = read.f();
|
||||||
|
|||||||
@@ -653,6 +653,15 @@ public class ApplicationTests{
|
|||||||
assertEquals(500, world.height());
|
assertEquals(500, world.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void load152BESave(){
|
||||||
|
resetWorld();
|
||||||
|
SaveIO.load(Core.files.internal("152_be.msav"));
|
||||||
|
|
||||||
|
assertEquals(414, world.width());
|
||||||
|
assertEquals(414, world.height());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void arrayIterators(){
|
void arrayIterators(){
|
||||||
Seq<String> arr = Seq.with("a", "b" , "c", "d", "e", "f");
|
Seq<String> arr = Seq.with("a", "b" , "c", "d", "e", "f");
|
||||||
|
|||||||
BIN
tests/src/test/resources/152_be.msav
Normal file
BIN
tests/src/test/resources/152_be.msav
Normal file
Binary file not shown.
Reference in New Issue
Block a user