Bugfixes for 78.1
This commit is contained in:
@@ -7,6 +7,7 @@ import io.anuke.arc.Events;
|
|||||||
import io.anuke.arc.collection.ObjectSet.ObjectSetIterator;
|
import io.anuke.arc.collection.ObjectSet.ObjectSetIterator;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
|
import io.anuke.mindustry.content.Items;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.*;
|
import io.anuke.mindustry.entities.*;
|
||||||
import io.anuke.mindustry.entities.type.Player;
|
import io.anuke.mindustry.entities.type.Player;
|
||||||
@@ -15,7 +16,6 @@ import io.anuke.mindustry.game.EventType.*;
|
|||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -66,9 +66,7 @@ public class Logic implements ApplicationListener{
|
|||||||
for(Team team : Team.all){
|
for(Team team : Team.all){
|
||||||
if(state.teams.isActive(team)){
|
if(state.teams.isActive(team)){
|
||||||
for(Tile core : state.teams.get(team).cores){
|
for(Tile core : state.teams.get(team).cores){
|
||||||
for(ItemStack stack : state.rules.startingItems){
|
core.entity.items.add(Items.copper, 200);
|
||||||
core.entity.items.add(stack.item, stack.amount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,8 +183,7 @@ public class MapView extends Element implements GestureListener{
|
|||||||
public void act(float delta){
|
public void act(float delta){
|
||||||
super.act(delta);
|
super.act(delta);
|
||||||
|
|
||||||
if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) &&
|
if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) && !Core.input.keyDown(KeyCode.CONTROL_LEFT)){
|
||||||
!Core.input.keyDown(KeyCode.CONTROL_LEFT)){
|
|
||||||
float ax = Core.input.axis(Binding.move_x);
|
float ax = Core.input.axis(Binding.move_x);
|
||||||
float ay = Core.input.axis(Binding.move_y);
|
float ay = Core.input.axis(Binding.move_y);
|
||||||
offsetx -= ax * 15f / zoom;
|
offsetx -= ax * 15f / zoom;
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ package io.anuke.mindustry.game;
|
|||||||
|
|
||||||
import io.anuke.annotations.Annotations.Serialize;
|
import io.anuke.annotations.Annotations.Serialize;
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.mindustry.content.Items;
|
|
||||||
import io.anuke.mindustry.io.JsonIO;
|
import io.anuke.mindustry.io.JsonIO;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.type.Zone;
|
import io.anuke.mindustry.type.Zone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,8 +63,6 @@ public class Rules{
|
|||||||
public boolean attackMode = false;
|
public boolean attackMode = false;
|
||||||
/** Whether this is the editor gamemode. */
|
/** Whether this is the editor gamemode. */
|
||||||
public boolean editor = false;
|
public boolean editor = false;
|
||||||
/** Items that the player starts with here. Not applicable to zones.*/
|
|
||||||
public Array<ItemStack> startingItems = Array.with(new ItemStack(Items.copper, 200));
|
|
||||||
|
|
||||||
/** Copies this ruleset exactly. Not very efficient at all, do not use often. */
|
/** Copies this ruleset exactly. Not very efficient at all, do not use often. */
|
||||||
public Rules copy(){
|
public Rules copy(){
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ public class JsonIO{
|
|||||||
private static Json json = new Json(){{
|
private static Json json = new Json(){{
|
||||||
setIgnoreUnknownFields(true);
|
setIgnoreUnknownFields(true);
|
||||||
setElementType(Rules.class, "spawns", SpawnGroup.class);
|
setElementType(Rules.class, "spawns", SpawnGroup.class);
|
||||||
setElementType(Rules.class, "startingItems", ItemStack.class);
|
|
||||||
|
|
||||||
setSerializer(Zone.class, new Serializer<Zone>(){
|
setSerializer(Zone.class, new Serializer<Zone>(){
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -100,19 +100,25 @@ public class CrashSender{
|
|||||||
ex(() -> value.addChild("os", new JsonValue(System.getProperty("os.name"))));
|
ex(() -> value.addChild("os", new JsonValue(System.getProperty("os.name"))));
|
||||||
ex(() -> value.addChild("trace", new JsonValue(parseException(exception))));
|
ex(() -> value.addChild("trace", new JsonValue(parseException(exception))));
|
||||||
|
|
||||||
|
boolean[] sent = {false};
|
||||||
|
|
||||||
Log.info("Sending crash report.");
|
Log.info("Sending crash report.");
|
||||||
//post to crash report URL
|
//post to crash report URL
|
||||||
Net.http(Vars.crashReportURL, "POST", value.toJson(OutputType.json), r -> {
|
Net.http(Vars.crashReportURL, "POST", value.toJson(OutputType.json), r -> {
|
||||||
Log.info("Crash sent successfully.");
|
Log.info("Crash sent successfully.");
|
||||||
|
sent[0] = true;
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}, t -> {
|
}, t -> {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
|
sent[0] = true;
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
//sleep for 10 seconds or until crash report is sent
|
//sleep until report is sent
|
||||||
try{
|
try{
|
||||||
Thread.sleep(10000);
|
while(!sent[0]){
|
||||||
|
Thread.sleep(30);
|
||||||
|
}
|
||||||
}catch(InterruptedException ignored){
|
}catch(InterruptedException ignored){
|
||||||
}
|
}
|
||||||
}catch(Throwable death){
|
}catch(Throwable death){
|
||||||
|
|||||||
@@ -72,10 +72,12 @@ public class MechPad extends Block{
|
|||||||
|
|
||||||
if(entity.player == null) return;
|
if(entity.player == null) return;
|
||||||
Mech mech = ((MechPad)tile.block()).mech;
|
Mech mech = ((MechPad)tile.block()).mech;
|
||||||
|
boolean resetSpawner = !entity.sameMech && entity.player.mech == mech;
|
||||||
entity.player.mech = !entity.sameMech && entity.player.mech == mech ? Mechs.starter : mech;
|
entity.player.mech = !entity.sameMech && entity.player.mech == mech ? Mechs.starter : mech;
|
||||||
|
|
||||||
entity.progress = 0;
|
entity.progress = 0;
|
||||||
entity.player.onRespawn(tile);
|
entity.player.onRespawn(tile);
|
||||||
|
if(resetSpawner) entity.player.lastSpawner = null;
|
||||||
entity.player = null;
|
entity.player = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user